• 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
How do I use variable with 'using terms from'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I use variable with 'using terms from'


  • Subject: How do I use variable with 'using terms from'
  • From: Brian Christmas <email@hidden>
  • Date: Sun, 29 Oct 2017 09:22:19 +1100

G’day scripters.

I hope this is the last missing piece in my app.

With using GraphicConverter, I need to use ‘using terms from’, but the code is
‘locked’ into using the text 'GraphicConverter 10'.

If at all possible, I need versatile code that will use ANY version of GC.

However, all my efforts have been in vain, that handler just wont accept any
variable.

As the old GC was just ‘GraphicsConverter;, and the new ones will be
‘GraphicConverter 11’ etc, I really, really need that variable method.

Any advice or guidance, please?

Regards

Santa

on printGraphicConverter()
        try
                tell application "Finder" to set theApps to (name of (every
item of folder (path to applications folder))) as list
                repeat with theApp2 in theApps
                        if theApp2 contains "GraphicConverter" then
                                set theUserApp to application theApp2
                                exit repeat
                        end if
                end repeat
                tell application "System Events"
                        set theApp to (bundle identifier of (info for (path to
theUserApp))) as text
                end tell
                tell application "Finder" to set theProcesses to (name of
processes) as list
                repeat with theApp2 in theProcesses
                        if theApp2 contains "GraphicConverter" then
                                set theUserProcess to theApp2 as text
                                exit repeat
                        end if
                end repeat
        end try
        #set temp to a reference to application "GraphicConverter 10"
        using terms from theUserApp
                tell application id theApp
                                        launch
                                        do shell script ("sleep 0.2")
                                        try
                                                close every window saving no
                                        end try
                                end tell
        end using terms from
 end printGraphicConverter

 _______________________________________________
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: How do I use variable with 'using terms from'
      • From: Steve Mills <email@hidden>
  • Prev by Date: Re: Seeing the state of an application with Script Editor?
  • Next by Date: Re: Seeing the state of an application with Script Editor?
  • Previous by thread: Re: Seeing the state of an application with Script Editor?
  • Next by thread: Re: How do I use variable with 'using terms from'
  • Index(es):
    • Date
    • Thread