Colonic irrigation (OS X)
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.