• 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: Creating property for 'tell application ...'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating property for 'tell application ...'


  • Subject: Re: Creating property for 'tell application ...'
  • From: "Marc K. Myers" <email@hidden>
  • Date: Tue, 16 Jul 2002 18:02:02 -0400
  • Organization: [very little]

> Date: Tue, 16 Jul 2002 12:17:24 -0700
> To: AppleScript-Users Mailing List <email@hidden>
> From: Jeff Shepherd <email@hidden>
> Subject: Creating property for 'tell application ...'
>
> I have a bunch of references to a particular application. For example
>
> tell application "GraphicConverter"
>
> Is there a way I can reference that in a property? For example
>
> property myApp : application "GraphicConverter"
>
> And then for the tell statement use
>
> tell myApp
>
> I just want to have one reference to the application in a single
> place. That way if I need to choose a different applications (for
> example, a different version) I only need to change a single
> reference.

In order to compile application-specific commands your script compiler
needs to know what application's dictionary to look at. You can do that
at compile time by using the "using terms from" construction, like this:

property theFinder : application "Finder"

set theFile to choose file
set theFldr to choose folder
using terms from application "Finder"
tell theFinder
move theFile to theFldr
end tell
end using terms from

Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[7/16/02 6:00:34 PM]
_______________________________________________
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.

  • Prev by Date: Re: Creating property for 'tell application ...'
  • Next by Date: IsRunning
  • Previous by thread: Re: Creating property for 'tell application ...'
  • Next by thread: Object types
  • Index(es):
    • Date
    • Thread