3
votes

I am trying to make an automator workflow, and I have a file path in a variable. I use this variable by accessing it with a "Get Value of Variable" block and pass the result as an argument to a "Run Applescript" Block. The "Run Applescript" block just opens a terminal window and passes the value of the variable as an argument to a script (dd if it matters).

Somewhere along the line, my file path is being messed up. All of the slashes are turning into colons (e.g. "...//Documents/Stuff" becomes "...::Documents:Stuff").

Why is this happening and how can I stop it from happening?

2
It is certainly "happening" because it is following the instructions you are giving it. There are two types of path descriptions for OSX, the legacy ":" based paths, and the unix style "/" Posix paths. The colon-delineated style is assumed by Applescript unless you specify Posix path. We have to see your code and/or the screen shot of your workflow to be able to pinpoint where the unintentional coercion is taking place. - jweaks

2 Answers

1
votes

If I have to guess the automator by default create file paths with "/". Try to add a line to the start of your "run applescript" to change it back to ":".

set YourVariable to (POSIX file (YourVariable)) as string
1
votes

As @jweaks said in a comment:

There are two types of path descriptions for OSX, the legacy ":" based paths, and the unix style "/" Posix paths. The colon-delineated style is assumed by Applescript unless you specify Posix path.

Using POSIX file results in slashes being used, but just file results in colons being used.