user1002430
user1002430

Reputation:

How to join Applescript paths?

Is there a more direct way to join paths together than to convert to and from a POSIX path in Applescript? For example:

POSIX file (POSIX path of (path to desktop folder) & "hello.txt")

Upvotes: 1

Views: 668

Answers (1)

vadian
vadian

Reputation: 285180

You can concatenate HFS paths (colon separated) this way

(path to desktop as text) & "hello.txt"

path to desktop returns an alias specifier.
The parameter as text coerces the alias specifier to HFS path

Upvotes: 1

Related Questions