Re: Can't tell an application to open
Re: Can't tell an application to open
- Subject: Re: Can't tell an application to open
- From: Shane Stanley <email@hidden>
- Date: Mon, 21 Feb 2011 08:22:46 +1100
- Thread-topic: Can't tell an application to open
On 21/2/11 4:24 AM, "Dave" <email@hidden> wrote:
> I've tried all kinds of variations, including using the chevron notation for
> "open" («event aevtodoc» theFile) and having the tell on the same line as the
> open, but they all bomb the same way. AppleScript is always giving the open
> command to the script instead of TextWrangler. Other commands (activate etc.)
> to TextWrangler are work normally.
That sounds like a problem with theFile. You're syntax works fine -- try
this and see:
set theFile to choose file
tell application "TextWrangler"
set textDocument to open theFile
end tell
You have probably made theFile by using POSIX path or alias as a specifier
rather than as a coercion -- the result of doing so returns the script
object rather than a reference to the file, which would explain what you're
seeing. (Something similar happens with file, but I doubt that you used
that.)
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden