Fwd: Scripting problem with GraphicConverter
Posted: Sat Jun 11, 2011 3:06 pm
Begin forwarded message: From: Christopher Stone <listmeister@thestoneforge.com>Date: June 10, 2011 10:32:18 PM MDTTo: AppleScript Users <applescript-users@lists.apple.com>Cc: Robert Poland <rpoland@usa.net>Subject: Re: Scripting problem with GraphicConverterOn Jun 08, 2011, at 08:27, Robert Poland wrote:I have this script that opens select GraphicConverter 7.X tool windows, positions them and sets their size.This script is called from the Scripts menu of GraphicConverter.If this script is run from Smile or ApplescriptEditor it works fine.But when called from GraphicConverter it gets an error, "System Events got an error: Can’t set window "Tools" of process "GraphicConverter" to {2343, 24}.".______________________________________________________________________Hey Bob,I've been fiddling with your script, and I've got something that works reliably on my machine from the GraphicConverter Scripts Menu.on moveToolsWindow(toolPalettePosition) try tell application "System Events" keystroke "k" using command down delay 0.01 -- Position Toolbox tell process "GraphicConverter" to tell window "Tools" set position to toolPalettePosition end tell end tell end tryend moveToolsWindowtell application "Finder" to set {fleftSide, fTopSide, fRightSide, fBottomSide} to bounds of window of desktopset screen_Top_Right to {fRightSide - 65, fTopSide + 22}with timeout of 0.02 seconds tell application "GraphicConverter" try if window 1 exists then tell window 1 -- main hide tools -- need GC 4.4.1b or later set window_Top_Right to {item 3, item 2} of (get bounds) -- Enable to move tool palette to right side of picture window 1 moveToolsWindow(window_Top_Right) of me -- Enable to move tool palette to right side of screen: -- moveToolsWindow(screen_Top_Right) of me end tell else beep end if on error errMsg number errNum beep display dialog "Error: " & errMsg & return & "Error Number: " & errNum end try end tellend timeoutIt still produces an error, but I'm trapping that and letting it go without action.I consider this a kludge rather than a real solution, but it does work. Perhaps it can be done with a more finesse using UI-Scripting, but I haven't looked very far into that as yet.Bob. You'll have to forward this to GcMac for me. I've renewed my membership, but it hasn't been confirmed yet.** THORSTEN: GraphicConverter 7.2 Applescript: 'hide tools' works fine, but 'show tools' does not work at all. It would also be nice if the tools palette had native properties like position and visible. Like Bob I often find myself wanting to position it precisely, although I usually stick it on the right side of my screen.--Best Regards,Chris Robert Poland - Fort Collins, CO