I have a longstanding AppleScript Studio tool which uses AppleScript
Studio to draw a drawing in AppleWorks, then save the results as a .png or
..pict file. It did this using a line like the following
-- ...
-- code to tell AppleWorks 6 to open a Drawing document and put something
in
-- ...
-- ...
set theTranslator to "PNG [QT]"
tell application "AppleWorks 6"
save the front document in fileAlias using translator theTranslator
end tell
This code no longer works under Leopard, yielding the following error
message:
AppleWorks 6 got an error: document 1 doesn't
understand the save message. (-1708)
.. My theory is this: the text "PNG [QT]", which used to be 8-bit text,
is now unicode text. The value being passed is thus scrambled by the time
it gets to AppleWorks (which is still Carbon, not Cocoa). So the
translator is not being selected correctly. If this is true, then Leopard
breaks AppleScripting in AppleWorks, so it's not surprising that Apple
don't support it any more.
Using some details from an Applescript release note I tried this
set rawTranslator to "PNG [QT]"
set listTranslator to id of rawTranslator
set theTranslator to string id listTranslator
Unfortunately this change makes no difference to my results.
HELP !
(A) Can I correct this problem by making minor changes to my script ?
(B) Does some command-line tool exist in OS X which will render text in a
graphics image ?
If you're going to suggest 'pic', 'groff', etc. for (B) please provide a
simple example.
Simon.
--
http://www.hearsay.demon.co.uk


|