Re: Creating property for 'tell application ...'
Re: Creating property for 'tell application ...'
- Subject: Re: Creating property for 'tell application ...'
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 16 Jul 2002 14:56:39 -0700
On 7/16/02 1:42 PM, "Anthony Adachi" <email@hidden> wrote:
>
On Tue, Jul 16, 2002 3:37 PM, Jeff Shepherd <email@hidden> wrote:
>
> 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.
>
>
>
>
As per your example, something like this works in Mac OS 9.1 with
>
AppleScript 1.8.3.
>
>
---
>
property myApp : application "BBEdit 6.5"
>
>
tell myApp
>
make new document
>
--> text document 1
>
end tell
>
---
That only works because 'document' is a term that AppleScript understands
without reference to the application in question. It will refuse to compile
when Jeff uses GraphicConverter terms.
As Emmanuel says, it won't compile for BBEdit or GraphicConverter or any
other application terms unique to the application.
Emanuel gives the raw code solution, which will always work for all OS's. If
Jeff is compiling his script in OS 9 or X (it can be _used_ in any OS), then
he does not need to know the raw codes:
using terms from application "GraphicConverter"
tell myApp
--any GC script
end tell
end using terms from
--
Paul Berkowitz
_______________________________________________
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.