lowtex
lowtex

Reputation: 727

In Automator, why are slashes in my file path being replaced with colons?

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?

Upvotes: 3

Views: 1183

Answers (2)

lowtex
lowtex

Reputation: 727

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.

Upvotes: 1

Tim Joe
Tim Joe

Reputation: 475

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

Upvotes: 1

Related Questions