Re: Path to Document in Script Editor
Re: Path to Document in Script Editor
- Subject: Re: Path to Document in Script Editor
- From: Luther Fuller <email@hidden>
- Date: Sat, 15 Mar 2008 19:23:58 -0500
On Mar 15, 2008, at 6:31 PM, deivy petrescu wrote:
On Mar 15, 2008, at 19:29, Luther Fuller wrote:
On Mar 15, 2008, at 6:19 PM, Paul Berkowitz wrote:
On 3/15/08 3:54 PM, "Luther Fuller" <email@hidden> wrote:
1. It's inside a 'tell application "Script Editor"' block.
2. I'm running it within Script Editor.
3. OS X 10.4.11
Right. It's the 'POSIX file' command not functioning inside the
explicit
Script Editor tell block. For some reason AppleScript won't run
the Standard
Additions command within the tell block, as it should, even
though it
compiles it so has obviously checked the Standard Additions
dictionary.
You can get around this without exiting the tell block by a 'tell
me to'.
tell app "Script Editor"
tell me to set docPath to POSIX file (path of (document of
window 1))
end tell
That works! Thanks.
Alternatively:
tell app "Script Editor"
set docPath to my POSIX file (path of (document of window 1))
end tell
I spoke too soon. 'tell me ... ' worked when I tested it alone, but
when I used this in my script, compiled to an application-bundle,
then tried it ... it did not work. Probably because 'tell me ...' now
refers to my application which knows nothing about posix.
I then tried deivy petrescu's suggestion to use
set docPath to my POSIX file (path of (document of window 1))
This did work! I removed all my work-around code and this section of
my code is now very simple. Thanks. Why does 'my' work, but not 'tell
me ...'?
_______________________________________________
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