AppleScript from a plug-in

adamfenn28's picture

I'm working on a plugin that will automate the control of Syphon Recorder (stop/start) and automatically archive the recorded videos.

I have created simple AppleScripts that stop and start the video, and I'm working on using NSAppleScript to execute them. I'm looking for an intelligent way to locate the scripts. Normally I might use NSBundle mainBundle, but that returns the path for QC, rather than for plugin, my AppleScript resources under my plugin can't be found that way. Is there a good way to return the directory of the my plugin, or should I just assume it's ~/Library/Graphics/Quartz Composer Plug-Ins?

Also.. I think I'd rather use the Scripting Bridge, than include AppleScript resources in my plugin. sdef/sdp can't seem to find the necessary files to create the necessary header file for use in the Scripting Bridge. Is there a way to work around this, or even a better way to do AppleScript from within my plugin?