Re: On the difficulties of "/"" in Applescript with example
Re: On the difficulties of "/"" in Applescript with example
- Subject: Re: On the difficulties of "/"" in Applescript with example
- From: Shane Stanley <email@hidden>
- Date: Fri, 18 Oct 2013 15:25:08 +1100
On 18 Oct 2013, at 2:30 PM, Manoah F. Adams <email@hidden> wrote:
> So the issue is more general than just quoting, it is related to the run-time behavior of "file".
You have never (well, not for a long time anyway) been able to build a file on the fly by using 'file "Some:path:to file"'; it only works in the context of an application or scripting addition command, where the app or addition supplies its own definition of file.
But not all files are the same. For example, run this:
set x to choose file
class of x
You will see that this "file" is of «class furl».
You can build a file on the fly using:
"Some:path:to file" as «class furl»
which will appear in the log as:
file "Macintosh HD:Some:path:to file"
(Note the insertion of the startup disk name, which only happens if it's not there already.)
And the other nice thing about furls is that you can also do this:
set x to "/Some/path/to file" as «class furl»
and the result is still:
file "Macintosh HD:Some:path:to file"
Most modern applications that return files actually return furls because Cocoa scripting handles the conversion from Cocoa's NSURLs for them automatically.
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden