Hi there everybody.
I got my hands on http://www.yvs.eu.com/imaginephoto.html and it’s scripting documentation which I found extremely well conceived and useful. Kudos to Kevin Meaney for his excellent work.
Unfortunately, development has stopped and Kevin seems to be fully tied up with other commitments, hence my request here in the forum.
I am using an automated worflow to create borders around images and would like to pass the results (an image file) to the following AppleScript:
on run
set whiteColor to {65535, 65535, 65535}
set blackColor to {0, 0, 0}
set thisFile to choose file with prompt "Select an image to draw text on: "
set file_info to (info for thisFile)
set file_name to name of file_info
-- to strip the extension from the name, uncomment the following two lines
--set the_ext to name extension of file_info
--set file_name to text 1 thru -((length of the_ext) + 2) of file_name
tell application "iMagine Photo"
set thisImporter to import graphic thisFile
if the component error of thisImporter is not equal to 0 then
close thisImporter
return
end if
set theWidth to 800
set theHeight to 600
set thisDocument to make new window document with properties {dimensions:{theWidth, theHeight}, name:" Drawing Window "}
set the drawing destination of thisImporter to thisDocument
set the destination rectangle of thisImporter to {0, 0, theWidth, theHeight}
draw thisImporter
close thisImporter
set textRecord to {class:standard text, font:"Times", font size:36, drawing text:file_name, start from:centre, start point:{theWidth div 2, theHeight div 2}, color:whiteColor, background color:blackColor, graphics mode:add pin, opcolor:{65535, 65535, 65535}, rotation:-90}
set {textWidth, textHeight} to get text dimensions with properties textRecord
set start point of textRecord to {theWidth - (textWidth div 2), theHeight div 2}
tell thisDocument to create composition element with properties textRecord
end tell
end run
which draws the file name on a border.
The above AppleScripts works manually but due to my limited experience, I don’t know how to automatically get the results coming from the workflow (an image file) into the script and finally save the file.
Can anybody help?
Thanking in advance
/Pieter
Model: iMac
AppleScript: 1.10.7
Browser: Firefox 2.0.0.1
Operating System: Mac OS X (10.4)