G’day scripters
I’ve got an ASObjC built application, that is opened by my main app, and passed a set of variables in a .dat file.
My problem is that the code is running as though it’s wrapped in molasses. The code snippet below runs as quick as a blink in vanilla Applescript, but is taking about 20 seconds in my app. Big, big wait for the whole app to process.
Can anyone throw any light on as to why please, and any possible fixes?
Regards
Santa
My app build starts with…
use AppleScript version "2.4" use framework "Foundation" use framework "AppKit" use scripting additions
script AppDelegate property parent : class "NSObject"
The code snippet is…
property rtfdPaperSize : "A4" property theCoverPagePrinter : "rtfd Printer"
tell application "TextEdit" activate try set p to 3 tell window 1 tell application "System Events" to tell process "TextEdit" set p to 4 click menu item "Page Setup…" of menu 1 of menu bar item "File" of menu bar 1 set p to 5 click pop up button 3 of sheet 1 of window 1 set p to 6 click menu item (my rtfdPaperSize of menu 1 of pop up button 3 of sheet 1 of window 1) set p to 7 click button "OK" of sheet 1 of window 1 end tell end tell end try set p to 8 print front document with properties {target printer:my theCoverPagePrinter} without print dialog try repeat while exists document frontmost set p to 9 close document frontmost without saving end repeat end try quit end tell
|