0
votes

I created this Automator app that creates the folders I need to start a new project, but I need to share it with my team, so instead of telling them to open Automator and set the path (doucments/projects/2020/) by themself. I was thinking that maybe they just can paste it in the 2020 folder, run the app and create the project folders in the same folder.

But I don't know how to set a variable with the current path where my Automator App it's saved. Any ideas? Thanks, guys!

My current workflow

1
Are you trying to set a specific path relative to the user — e.g., ~/Documents/Projects/2020 — or a path relative to the folder the automator app is in? The first is trivial, the second not so much...Ted Wrigley
I was thinking in a path relative to the folder the app is in... but if It is too complicated, I think setting a specific path relative to the user could work too, Is there any way to set it, without using the predetermined Automator action? Thanks for your answer man!Gabriel Razo

1 Answers

0
votes

To create a new folder in a specific location of the user's home folder, you can use the the special 'location' variables that automator defines. Click the variables tab button in the upper left corner of the automator window to see the full list of available variables...

variables tab location

So, to create a folder hierarchy like the one shown in the link, but at a standardized location in the documents folder, use a flow like the following:

enter image description here

Since Automator doesn't have a specific variable that gives the location of the created workflow app, if you want a path relative to the app's location you'd use a Run AppleScript action and try to path to me command, but every time I've tried it I've received weird errors which make me think that command doesn't work correctly in Automator. I mean, the following ought to produce the correct result, but it consistently errors out:

enter image description here

Maybe you can make it function...