I am a beginning scripter. I need some help understanding when (why) to use an applescript path delimited by colons, a posix path with slashes, or an alias. I have looked in several books and online but cannot get a clear understanding.
Do applications like Finder or System Events or Aperture require a reference to a file or folder in a certain form?
When must it be quoted?
Sorry for the neophyte type question.
There are indeed multiple ways of indicating a location of a file and the introduction of Mac OS X (read: cocoa) didn’t made things easier. It’s hard to say what to use when the dictionary is not clear about what to use. I can give you some insight about the difference itself, but I’m not sure if it helps
file “hfs path to file” is a file object (furl)
alias “path to file” is an alias class object
posix file “ufs/posix path to file” is a file object (furl)
diskitem in system events is an object specifier
Finder works both with alias as with object specifiers
do shell script works with strings (and needs to be in a quoted form)
quoted form should only be used on the command line; it’s needed in do shell script as do script in the terminal.
The differences between an object specifier and an class is that object specifiers can often be used with a filter (whose/where clause).