[ANN] GraphicConverter 9.7 Build 2030

This area contains the messages from the old Yahoo gcmac group after the port.
Brian Christmas
Posts: 0
Joined: Thu Nov 18, 2010 10:02 pm

Cannot trap printing of animated gifs with GUI

Post by Brian Christmas »

G’day Thorsten I’d like to be able to print the first image of animated gifs using Applescript. A message pops up offering this option, but it’s not trappable. The process does not move past 'keystroke p using command down’. Is it possible to alter GraphicConverter so the message can be trapped, and the default button recognised in the window, please? Regards Santa
thorstenlemke
Posts: 0
Joined: Fri Dec 30, 2016 12:00 pm

Re: Cannot trap printing of animated gifs with GUI

Post by thorstenlemke »

Hello,which message?Thorsten A message pops up offering this option, but it’s not trappable. The process does not move past 'keystroke p using command down’.
Brian Christmas
Posts: 0
Joined: Thu Nov 18, 2010 10:02 pm

Re: Cannot trap printing of animated gifs with GUI

Post by Brian Christmas »

On 22 Jun 2015, at 3:19 pm, Thorsten Lemke lemke@lemkesoft.de [gcmac] <gcmac@yahoogroups.com> wrote:Hello,which message?Thorsten A message pops up offering this option, but it’s not trappable. The process does not move past 'keystroke p using command down’.
thorstenlemke
Posts: 0
Joined: Fri Dec 30, 2016 12:00 pm

Re: Cannot trap printing of animated gifs with GUI [1 Attachment]

Post by thorstenlemke »

Hello,I released a new beta.Please check:http://www.lemkesoft.org/beta.htmlThat should fix it.Thorsten [Attachment(s) from Brian Christmas included below]On 22 Jun 2015, at 3:19 pm, Thorsten Lemke lemke@lemkesoft.de [gcmac] <gcmac@yahoogroups.com> wrote:Hello,
Brian Christmas
Posts: 0
Joined: Thu Nov 18, 2010 10:02 pm

Re: Cannot trap printing of animated gifs with GUI

Post by Brian Christmas »

G’day ThorstenThank you for your prompt attention to my problem.Unfortunately while it words while running code in Applescript, it still brings up the unaddressable problem when running he same code in an Applescript ObjectC project.I don’t know why it should be different, but it simply is.The code is below. Note I’m adding two text boxes.RegardsSantaproperty theLargePagePrinter : "Large Page Printer"property theItem : ((path to desktop) & "image001.gif" as text)property attachmentBarCodeDateTimeName : "20150622 121212Z"property PreserveFileName : " This is a test of GraphicConverter"property tempName : ""property tempNameExtension : ""my printGraphicConverter()--+++++++ GraphicConverteron printGraphicConverter() set keepGoingFlag to false #if not my onlyPrintIndandQuarkflag or (my onlyPrintIndandQuarkflag and my ftpPrintFlag) then set keepGoingFlag to true tell application "GraphicConverter 9" activate try close every window saving no end try tell application "Finder" if kind of file (my theItem) contains "font" then say "graphic converter found a font file" return end if end tell try set foundAFile to false silentopen file (my theItem) tell current application to delay 0.2 set x to 0 set foundAFile to true end try end tell #end if if keepGoingFlag and foundAFile then tell application "Finder" set my tempName to name of file (my theItem) as text set my tempNameExtension to name extension of file (my theItem) as text end tell tell application "GraphicConverter 9" activate try set addBarCode to false if my tempName does not contain "_UEI " then set addBarCode to true if addBarCode then tell window 1 try set TheRes to resolution set resolutionChangeFlag to false if item 1 of TheRes < 300 then set item 1 of TheRes to 300 set resolutionChangeFlag to true end if if item 2 of TheRes < 300 then set item 2 of TheRes to 300 set resolutionChangeFlag to true end if if resolutionChangeFlag then change resolution to TheRes with resample tell application "GraphicConverter 9" to activate tell application "System Events" to tell process "GraphicConverter" try click menu item "Flatten" of menu 1 of menu item "Alpha Channel" of menu 1 of menu bar item "Picture" of menu bar 1 end try end tell tell application "GraphicConverter 9" to activate try trim end try (*set TheRes to resolution set HRes to item 1 of TheRes set VRes to item 2 of TheRes set ImageDim to image dimension set WDim to item 1 of ImageDim as integer set HDim to item 2 of ImageDim as integer*) set background color to {65535, 65535, 65535} set theRequiredChange to ((item 1 of TheRes) / 300 div 1) copy image dimension to {imageWidth, imageHeight} set rightMargin to 0 if imageWidth < (1600 * theRequiredChange) then set rightMargin to (1600 * theRequiredChange) - imageWidth end if set topMargin to 130 * theRequiredChange tell application "GraphicConverter 9" to activate change margins with {4, topMargin, rightMargin, 4} copy image dimension to {imageWidth, textVerticalPosition} # set textVerticalPosition to item 2 of (get image dimension) # tell application "GraphicConverter 9" to activate draw text into text my attachmentBarCodeDateTimeName & "Z)" justification 0 color {0, 0, 0} box {10, textVerticalPosition - (120 * theRequiredChange), imageWidth, textVerticalPosition} font "IDAutomationHC39M" size (30 * theRequiredChange) # tell application "GraphicConverter 9" to activate draw text into text my PreserveFileName justification 0 color {0, 0, 0} box {(580 * theRequiredChange), textVerticalPosition - (120 * theRequiredChange), imageWidth, textVerticalPosition - (30 * theRequiredChange)} font "Times" size (50 * theRequiredChange) # tell current application to delay 2 on error errmsg number errnum if errnum ≠ -1700 then tell application "System Events" to display dialog "Error in 'draw text into' in GraphicConverter " & errmsg & " number " & errnum giving up after 40 else # set my didItPrint to false return end if end try end tell end if end try end tell tell application "GraphicConverter 9" activate set GCWindowName to name of window 1 as text tell current application to delay 0.2 set tempflag to false tell application "System Events" to tell process "GraphicConverter 9" tell current application to delay 0.2 tell application "GraphicConverter 9" to activate keystroke "p" using command down tell current application to delay 0.2 activate set GCWindowName to name of window 1 as text try if exists button "Save Current Only" of window 1 then keystroke return try click button "Save Current Only" of window 1 end try end if end try set x to 0 repeat until exists sheet 1 of window 1 tell current application to delay 0.1 set x to x + 1 if x > 50 then say "exiting" exit repeat end if end repeat tell current application to delay 0.2 set reShowSheet to false activate tell sheet 1 of window 1 if exists button "Show Details" then click button "Show Details" repeat until exists button "Hide Details" tell current application to delay 0.1 end repeat tell current application to delay 0.2 click button "Cancel" set reShowSheet to true end if end tell if reShowSheet then keystroke "p" using command down repeat until exists sheet 1 of window 1 tell current application to delay 0.1 end repeat end if activate tell current application to delay 0.4
thorstenlemke
Posts: 0
Joined: Fri Dec 30, 2016 12:00 pm

Re: Cannot trap printing of animated gifs with GUI

Post by thorstenlemke »

Dear Santa,which problem? What is the error message?Thorsten Unfortunately while it words while running code in Applescript, it still brings up the unaddressable problem when running he same code in an Applescript ObjectC project.
Brian Christmas
Posts: 0
Joined: Thu Nov 18, 2010 10:02 pm

Re: Cannot trap printing of animated gifs with GUI

Post by Brian Christmas »

Thorsten, my apologies.The error is occurring in a section of code I didn’t include as I didn’t think the variable was turned on. It’s actually in a ‘Saving’ part.The pop up dialog is still not trappable, even with a ‘try’ 'on error’Code is below.I’ve built a small project that displays the problem. Attached.RegardsSantatell application "GraphicConverter 9" activate try set addToPrintTally to false if addBarCode then set addToPrintTally to true if my saveftpFiles then try set newPath to my setUpSavePath("_UEI ftpSaving") as text if (my tempNameExtension as text) is in {""} then #  set addToPrintTally to false if not my ftpPrintFlag then set my errorMessage to my errorMessage & "I've encountered a file with a name extension of '" & my tempNameExtension & "' and cannot barcode it. You might want to open the file in GraphicConverter, save it as a jpeg, insert the new jpeg file into a Draft version of the old email which should be stored in mail folder '*items to manually process', delete the old file from the message, and forward the message back to UEI Sales." else tell application "Finder" to set nameOfholdingFolder to name of folder (my holdingFolder) tell application "Finder" to set nameOfTheItem to name of file (my theItem) set my errorMessage to my errorMessage & "I've encountered an ftp downloaded file with a name extension of '" & my tempNameExtension & "' and cannot barcode it. You might want to open the file '" & nameOfTheItem & "' in GraphicConverter, save it as a jpeg, insert the new jpeg file into a new email, and send the message back to UEI Sales." & return & return & "You'll find the original file in the zipped file '" & nameOfholdingFolder & ".zip' in todays folder in folder 'Yearly Orders " & (items 1 thru 4 of nameOfholdingFolder as text) & "' in the desktop folder 'Mail Manager Folder'." end if else try # Problem occurs here. save window 1 in file newPath with replacing on error tell application "System Events" to tell process "GraphicConverter 9" if exists button "Save Current Only" of window 1 then keystroke return try click button "Save Current Only" of window 1 end try end if end tell end try set end of my preFlightpdfList to newPath end if on error errmsg tell application "System Events" to display dialog "GraphicConverter saving error  " & errmsg giving up after 40 end try if my ftpPrintFlag then set my mailReadyToSend to true end if end if on error errmsg number errnum if errnum is not in {-1700, -1} then set my didItPrint to false set my errorMessage to my errorMessage & "A file without a correct name extension has been found, and possibly cannot be printed automatically by Graphic Converter. error number " & errnum & " error type " & errmsg & return if my sayEveryErrorMessage then my sayTheText("A file without a name extension has been found, and possibly cannot be printed automatically by Graphic Converter.") if my RunForOz then tell application "System Events" to display dialog "GraphicConverter print error " & errmsg & " error number " & errnum giving up after 40 end if end try end tell
thorstenlemke
Posts: 0
Joined: Fri Dec 30, 2016 12:00 pm

Re: Cannot trap printing of animated gifs with GUI [1 Attachment]

Post by thorstenlemke »

Hello,I get here no error.Just a new saved file with the text at the top.Please e-mail a screenshot of the dialog.Thorsten Thorsten, my apologies.The error is occurring in a section of code I didn’t include as I didn’t think the variable was turned on. It’s actually in a ‘Saving’ part.The pop up dialog is still not trappable, even with a ‘try’ 'on error’Code is below.I’ve built a small project that displays the problem. Attached.RegardsSanta
Brian Christmas
Posts: 0
Joined: Thu Nov 18, 2010 10:02 pm

Re: Cannot trap printing of animated gifs with GUI

Post by Brian Christmas »

G’day ThorstenI’ve stripped the code to basics, and this time you should get an error. The Archive contains the App, and a file that it references, just drag the expanded .gif to your desktop, please, and run the app.Screen shot also attached.RegardsBrian ChristmasOn 23 Jun 2015, at 9:24 pm, Thorsten Lemke lemke@lemkesoft.de [gcmac] <gcmac@yahoogroups.com> wrote:Hello,I get here no error.Just a new saved file with the text at the top.Please e-mail a screenshot of the dialog.Thorsten
thorstenlemke
Posts: 0
Joined: Fri Dec 30, 2016 12:00 pm

Re: Cannot trap printing of animated gifs with GUI [2 Attachments]

Post by thorstenlemke »

Dear Brian,please download the latest BETA:http://www.lemkesoft.org/beta.htmland uncheck the option “Show notes”.Thorsten G’day ThorstenI’ve stripped the code to basics, and this time you should get an error. The Archive contains the App, and a file that it references, just drag the expanded .gif to your desktop, please, and run the app.Screen shot also attached.RegardsBrian Christmas
Post Reply