• 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
Re: Can't tell an application to open
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Can't tell an application to open
      • From: Dave <email@hidden>
References: 
 >Can't tell an application to open (From: Dave <email@hidden>)

  • Prev by Date: Re: Can't tell an application to open
  • Next by Date: Re: Can't tell an application to open
  • Previous by thread: Re: Can't tell an application to open
  • Next by thread: Re: Can't tell an application to open
  • Index(es):
    • Date
    • Thread