Skip to main content
Participant
September 10, 2008
Question

Image Events

  • September 10, 2008
  • 2 replies
  • 483 views
Platform: MacOS X.5.4
Scriptlanguage: Applescript with ScriptDebugger.
Application to script: Sorry, no InDesign but: Image Events

Hello,

I wrote an Applescript that tells the application "Image Events" to create thumbnails from selected jpg and/or pdf files.

Here's a fragment of my script:
tell application "Image Events"
set the_copiedFile to open nameoftheThumbnailfile

-- resize file to max 175 pixels.
scale the_copiedFile to size 175

-- set canvas size to 175 x 175 pixels.
pad the_copiedFile to dimensions {175, 175} --with pad color {255, 255, 255}
save the_copiedFile as JPEG in whereToSave
close the_copiedFile
end tell

In the above example the result pad color will be black. But I want the pad color to be white, so I added a small piece of script: with pad color {255, 255, 255}, which is commented in the above fragment. When I uncomment it, then the script should work properly, according to the dictionary of Image Events, but unfortunately it doesn't. I get no Applescript error, but instead of a nice white background color, the file isn't padded at all. It even isn't scaled to 175 pixels!!! Strange but true.

Anybody any idea? The code is properly compiled, so I guess I have a bug here?

Kind regards, Bertus Bolknak
This topic has been closed for replies.

2 replies

Participant
September 16, 2008
Thank you for your answer Shane, I did some investigation in the meantime and it got things working. To set the pad color to white, I used {65535, 65535, 65535} instead of {255, 255, 255}.

Kind regards Bertus Bolknak.
Inspiring
September 11, 2008
Last I looked, Image Events in Leopard had plenty of bugs. Your best bet is<br />to use "do shell script" and the command-line tool sips.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>