i'm trying to access a function in an applescript.app i've
written...in applescript it's:
tell application "playRec"
initRecList(false)
set recList to listRecDict() -- returns a list of records
end tell
but i want to do it in py-appscript (so i can use cheetah) but
ASTranslate errors: Untranslated event 'ascrpsbr'
Appscript doesn't provide an API for calling user-defined
subroutines. You need to drop into aem and use raw AE codes to do that.
i've set NSAppleScriptEnabled in my app's info.plist, and created
an sdef as suggested in http://lists.apple.com/archives/applescript-
implementors/2004/Feb/msg00028.html
but i've not found any docs showing how to link the sdef to my
applescript...
The simplest thing would probably be to call your applet's user-
defined subroutines via aem:
If you really want to add a dictionary, assuming you've saved your
applet as a bundle, use sdp to convert your sdef to a .r file, then
use Rez to append it to your applet's applet.rsrc file:
sdp -fa playRec.sdef
Rez playRec.r -a -o applet.rsrc -useDF
You'll need to define your applet's handlers using the raw AE codes
given in your dictionary, of course, e.g.