Applescript: get path
Wayne Brissette
waynefb at earthlink.net
Fri Mar 21 11:21:01 PST 2003
Jonathan Lewis jonathan_lewis at mac.com on Saturday, March 22, 2003 stated:
>which isn't useful for me as I want the results of the script to be
>automatically saved in the same folder as the frontmost OO document. I
>could navigate to the folder every time, but that rather defeats the
>point of writing a script.
I think there's a problem with the Path command in OO. To illustrate this
you use the same code in TextEdit and OO since the path keyword is the
same in both dictionaries.
tell application "TextEdit"
set theDoc to front document
set MySelection to name of theDoc
copy (path of theDoc) to MyPath
end tell
tell application "Finder"
display dialog MyPath
end tell
tell application "OmniOutliner"
set theDoc to front document
set MySelection to name of theDoc
copy (path of theDoc) to MyPath
end tell
tell application "Finder"
display dialog MyPath
end tell
What you'll find is that the TextEdit version diplays the proper path,
whereas the OO version fails with an error 10. :-(
Anybody else seen this?
Wayne
--
No people is wholly civilized where a distinction is drawn between
stealing an office and stealing a purse.
- Theodore Roosevelt
Live DAT & Music Page: http://homepage.mac.com/wayneb/
PowerMail AppleScript Archives: http://homepage.mac.com/wayneb/powermail.html
Music Currently playing: Paul Weller "One X One" : Illumination
More information about the OmniOutliner-Users
mailing list