What's the REAL problem, please?


Brian Christmas
 

G’day

I’m trying altering code in my printing App to be able to use almost ANY recent version of different printing Apps.

So, I've resorted to trying to open each app with its bundle identifier.

Compiled OK (Acrobat, Illustrator, InDesign), until I got to GraphicConverter (using Script Debugger), where I found the bundle id has a number, the same as the App version number (10)

So, I wrote code to overcome this, then found certain aspects of my GraphicConverter handler will no longer compile.

Trouble is, is it the Compiler, or GraphicConverter???

I’ve whipped of a request to Thorsten Lemke, but also thought I’d bounce the question of these two groups.

Below is a snippet I wrote to test the problem.

Any thoughts, particularly from the Authors of Script Debugger?

Any alternative methods? This is REALLY important, please!

Regards

Santa

property theItem : ((path to desktop as text) & "Numbers_Chart.jpg")

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)) — Returns "com.lemkesoft.graphicconverter10"
end tell

tell application id theApp to activate

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

tell (application id theApp)
activate
# silentopen file (my theItem) — Won’t compile
open file (my theItem)
tell window 1
try
set TheRes to resolution
set resolutionChangeFlag to false
if item 1 of TheRes < 600 then
set item 1 of TheRes to 600
set resolutionChangeFlag to true
end if
if item 2 of TheRes < 600 then
set item 2 of TheRes to 600
set resolutionChangeFlag to true
end if
#if resolutionChangeFlag then change resolution to TheRes with resample — Won’t compile
end try
end tell
end tell

Join applescript@apple-dev.groups.io to automatically receive all group messages.