Applescript scale command in GC 8.3

This area contains the messages from the old Yahoo gcmac group after the port.
Post Reply
sptimde
Posts: 0
Joined: Wed Oct 10, 2012 3:20 pm

Applescript scale command in GC 8.3

Post by sptimde »

Hi, I used the following Applescript to open an image from the clipboard and scale it down. tell application id "com.lemkesoft.graphicconverter" new image from clipboard scale window 1 horizontal 0.5 vertical 0.5 activate end tell Using GC 8.3 this does not work anymore. Applescript Editor highlights the word "horizontal" and gives the error message "syntax error: Expected end of line, etc. but found application constant or consideration." Any ideas why this happens? TIA sptim
Karsten Wolf
Posts: 0
Joined: Wed Dec 07, 2011 7:53 pm

Re: Applescript scale command in GC 8.3

Post by Karsten Wolf »

I had a similar error, that occurred when GC8.3 was started by the script. Starting it manually beforehand and giving it 5-10 seconds to initialize solved (kind of) the problem. -karsten Am 10.10.2012 um 14:20 schrieb sptimde: > Hi, > > I used the following Applescript to open an image from the > clipboard and scale it down. > > tell application id "com.lemkesoft.graphicconverter" > new image from clipboard > scale window 1 horizontal 0.5 vertical 0.5 > activate > end tell > > Using GC 8.3 this does not work anymore. Applescript Editor > highlights the word "horizontal" and gives the error message > "syntax error: Expected end of line, etc. but found application > constant or consideration." > > Any ideas why this happens?
Robert Poland
Posts: 0
Joined: Sun Jan 03, 2010 3:45 pm

Re: Applescript scale command in GC 8.3

Post by Robert Poland »

Hi,In a similar script I use this; tell application "System Events" to set activeProcesses to name of every process if activeProcesses does not contain "GraphicConverter" then repeat while activeProcesses does not contain "GraphicConverter" tell application "System Events" to set activeProcesses to name of every process tell application "GraphicConverter" activate end tell delay 0.2 end repeat end ifOn Oct 10, 2012, at 6:34 AM, Karsten Wolf <karstenwo@googlemail.com> wrote: I had a similar error, that occurred when GC8.3 was started by the  script. Starting it manually beforehand and giving it 5-10 seconds to  initialize solved (kind of) the problem.-karstenAm 10.10.2012 um 14:20 schrieb sptimde:Hi,I used the following Applescript to open an image from the  clipboard and scale it down.tell application id "com.lemkesoft.graphicconverter" new image from clipboard scale window 1 horizontal 0.5 vertical 0.5 activateend tellUsing GC 8.3 this does not work anymore. Applescript Editor  highlights the word "horizontal" and gives the error message  "syntax error: Expected end of line, etc. but found application  constant or consideration."Any ideas why this happens?------------------------------------Yahoo! Groups Links<*> To visit your group on the web, go to:    http://groups.yahoo.com/group/gcmac/<*> Your email settings:    Individual Email : Traditional<*> To change settings online go to:    http://groups.yahoo.com/group/gcmac/join    (Yahoo! ID required)<*> To change settings via email:    gcmac-digest@yahoogroups.com    gcmac-fullfeatured@yahoogroups.com<*> To unsubscribe from this group, send an email to:    gcmac-unsubscribe@yahoogroups.com<*> Your use of Yahoo! Groups is subject to:    http://docs.yahoo.com/info/terms/ Robert Poland - Fort Collins, CO
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: Applescript scale command in GC 8.3

Post by Christopher Stone »

On Oct 10, 2012, at 07:20, sptimde <egt@mecking.net> wrote: Using GC 8.3 this does not work anymore. Applescript Editor highlights the word "horizontal" and gives the error message "syntax error: Expected end of line, etc. but found application constant or consideration."______________________________________________________________________Hey There,It works fine on my system with the 8.3.1 beta.Bob's solution should work, but I don't like using System Events unless absolutely necessary.I'd try this:tell application id "com.lemkesoft.graphicconverter" launchend telltell application id "com.lemkesoft.graphicconverter" new image from clipboard scale window 1 horizontal 0.5 vertical 0.5 activateend tellThe first tell should finish executing before the second one continues.--Best Regards,Chris
sptimde
Posts: 0
Joined: Wed Oct 10, 2012 3:20 pm

Re: Applescript scale command in GC 8.3

Post by sptimde »

Thank you, guys.Launching GC before trying to scale did not work. The right hint was: > It works fine on my system with the 8.3.1 beta. After upgrading to the beta the problem was gone.Bye, spTim
sptimde
Posts: 0
Joined: Wed Oct 10, 2012 3:20 pm

Re: Applescript scale command in GC 8.3

Post by sptimde »

Hi,as mentioned in another reply, the problem was solved by upgrading to 8.3.1 beta. > tell application "System Events" to set activeProcesses to name of every process> if activeProcesses does not contain "GraphicConverter" then>     repeat while activeProcesses does not contain "GraphicConverter">         tell application "System Events" to set activeProcesses to name of every process>         tell application "GraphicConverter">             activate>         end tell>         delay 0.2>     end repeat> end if Since either Leopard or Snow Leopard this can be done easier and without using System Events:repeat while application "GraphicConverter" is not running    tell application "GraphicConverter" to activate    delay 0.2end repeatBye,sptim
Post Reply