Hi everybody - I’m new here and pretty new to AppleScript. What a wonderful recourse, this site is.
To my problem then:
I’m writing a script to generate some images with text on them. They’re to be used as leading frames in videos of experiments, detailing the experiment at hand.
The script uses AppleScript and Finder to build a shell command to get ImageMagick to produce the desired first frame.
The piece generating the command is here:
set shellCommand to "/usr/local/bin/convert -size 1920x1080 xc: -font Helvetica -fill black -pointsize " & titleFontSize & " -draw 'text " & titleXInsert & "," & titleYInsert & " \"" & titleStr & "\"' " & quoted form of (origFolderPath & "testFP1.jpg")
The result of that is this:
do shell script "/usr/local/bin/convert -size 1920x1080 xc: -font Helvetica -fill black -pointsize 60 -draw 'text 250,250 \"Forth Replacement Crossing\"' '/Volumes/HDD/Movies/Video Recordings FRC/Buffering induced vibrations, CSB/Annex C1 - Configuration 1/testFP1.jpg'"
It executes fine, and testFP1.jpg is created in the desired path. However, the image is just the blank canvas - no text.
Pasting the resulting shellCommand (removing ) directly into Terminal, does produce the image with text in the desired position. I think convert gives a clue here. Besides the testFP1.jpg , I also get this message in Terminal:
If I in Terminal perform the same command but without the /usr/local/bin/ I still get the image with text, but no message. But using this in the script doesn’t find the convert programme. (I got the /usr/local/bin/ from here: http://macscripter.net/viewtopic.php?id=18375)
I also tried doing a different command instead of text placing another image in the canvas (using -composite), and the result there was as expected.
Thus inspired I tried using -annotate instead which still produced no text when called from the Apple script.
So - I’m thinking maybe the problem is related to looking up fonts - maybe. Or from some reading I did (elsewhere that I can’t recall) maybe related to Ghost Script not being found.
I don’t know how to test if these are the issues, or what to do about it.
Can someone help me on this?
Thanks a lot in advance!