Re: Double Tell - Tell by Variable Question
Re: Double Tell - Tell by Variable Question
- Subject: Re: Double Tell - Tell by Variable Question
- From: Shane Stanley <email@hidden>
- Date: Fri, 26 Jun 2015 19:41:12 +1000
On 26 Jun 2015, at 7:15 pm, Dave <email@hidden> wrote:
>
> I don’t want to use the name “calculator”, because I want the Script to be able to talk to whichever app is currently being targeted.
The only way that can work is if your script uses the (relatively few) commands and classes common to all the potential targets. And if that's the case, wrapping it in a "using terms from" block targeting any of those apps will work fine -- it's sole purpose is to give the AppleScript compiler somewhere to look for terminology.
For example:
set x to "Finder"
using terms from application "Adobe Illustrator"
tell application x
set y to name of window 1
end tell
end using terms from
y will contain the name of the front window in Finder.
But there's not a lot you can do if you're limited to commands and classes common to a range of apps anyway.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
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