• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: On the difficulties of "/"" in Applescript with example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: On the difficulties of "/"" in Applescript with example
      • From: "Manoah F. Adams" <email@hidden>
References: 
 >On the difficulties of "/"" in Applescript with example (From: Walter Bushell <email@hidden>)
 >Re: On the difficulties of "/"" in Applescript with example (From: "Manoah F. Adams" <email@hidden>)

  • Prev by Date: Re: On the difficulties of "/"" in Applescript with example
  • Next by Date: Re: On the difficulties of "/"" in Applescript with example
  • Previous by thread: Re: On the difficulties of "/"" in Applescript with example
  • Next by thread: Re: On the difficulties of "/"" in Applescript with example
  • Index(es):
    • Date
    • Thread