• 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: Double Tell - Tell by Variable Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Double Tell - Tell by Variable Question
      • From: Dave <email@hidden>
References: 
 >Double Tell - Tell by Variable Question (From: Dave <email@hidden>)
 >Re: Double Tell - Tell by Variable Question (From: Shane Stanley <email@hidden>)
 >Re: Double Tell - Tell by Variable Question (From: Dave <email@hidden>)
 >Re: Double Tell - Tell by Variable Question (From: Shane Stanley <email@hidden>)
 >Re: Double Tell - Tell by Variable Question (From: Dave <email@hidden>)

  • Prev by Date: Re: Mac InDesign CS5.5 & fonts
  • Next by Date: Re: Mac InDesign CS5.5 & fonts
  • Previous by thread: Re: Double Tell - Tell by Variable Question
  • Next by thread: Re: Double Tell - Tell by Variable Question
  • Index(es):
    • Date
    • Thread