• 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
Colonic irrigation (OS X)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Colonic irrigation (OS X)


  • Subject: Colonic irrigation (OS X)
  • From: Mr Tea <email@hidden>
  • Date: Wed, 11 Feb 2004 23:05:14 +0000

Hi, folks.

Either I'm confused about colons, or AppleScript is, or we both are....

tell application "Finder"
activate
open item ((path to desktop folder as string) & "F1:F2:")
end tell

That's straightforward enough. If there's a folder on my desktop called
'F1', containing a folder called 'F2', the above script will open it.
However, if I replace the folder 'F2' with a file of the same name, the
script will open that instead, without a whisper of complaint.

Similarly, if I leave the final colon off the file/folder path, AS will
indiscriminately open F2 regardless of whether it's a file or a folder.

I noticed this uncharacteristically forgiving behaviour while testing a
script for another poster (Syllas R. - Error in the Finder). That script
apparently opened a folder in OS 9 without needing the final colon in the
path, so this clearly isn't an OS X thing.

The magic formula for making AS 'colon-blind' seems to lie in the outer set
of brackets in the 'open' line. When these are removed, the expected error
messages are generated if the presence or absence of a final colon is
inappropriate.

Bug or feature?


Regards,


Nick
pp Mr Tea

--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Colonic irrigation (OS X)
      • From: Walter Ian Kaye <email@hidden>
    • Re: Colonic irrigation (OS X)
      • From: Christopher Nebel <email@hidden>
    • Re: Colonic irrigation (OS X)
      • From: Lachlan Deck <email@hidden>
  • Prev by Date: Re: Newbie question:
  • Next by Date: On Run handlers
  • Previous by thread: Re: AppleScript under OS X
  • Next by thread: Re: Colonic irrigation (OS X)
  • Index(es):
    • Date
    • Thread