Envrionment Variables inside Info.plist

Long story short, I’m working on a script that has ImageMagick inside the bundle. If I type out the MAGICK_HOME and DYLD_LIBRARY_PATH in the Info.plist Environtment variables - it works perfectly.

How do I set the variables so that no matter where the app is put it will have the correct paths?

I try something to the effect of … do shell script “MAGICK_HOME=…”

I also tried to tell System Events edit the plist file, which it doesnt do want to do. (example here)

Thoughts?

Looking into it more I think it might work if I put the export commands in the same “do shell script” command. I’m just working out the kinks


on run argv
set packageContents to item 1 of argv
set droppedfile to item 2 of argv
set stamped to (do shell script "date +%s")
do shell script "export MAGICK_HOME=\"" & packageContents & "/Contents/Resources/ImageMagick-6.4.1/\";export DYLD_LIBRARY_PATH=\"" & packageContents & "/Contents/Resources/ImageMagick-6.4.1/bin\";"& packageContents & "/Contents/Resources/ImageMagick-6.4.1/bin/convert " & droppedfile & " -resample 72 " & droppedfile & "." & stamped & ".jpg"
end run


…and the problem was … the library file was in /lib/ not /bin/

While I’m talking to myself - any idea on how to get gs/ghostscript loaded to to take advantage of the ps actions in imagemagick?