Sending an apple event with custom parameters (BBEdit roundtrip)
Ben Rubinstein
benr_mc at cogapp.com
Wed Aug 30 05:11:21 EDT 2006
I want to send an AppleEvent with custom parameters, not covered in the
application's dictionary.
Specifically, I want to implement BBEdit round-trip editing - which perhaps
others have already done?
Essentially the missing piece in this is that when you invite BBEdit to open a
document, you supply an extra parameter (keyServerID); it then knows to notify
your application via an AppleEvent when the document is saved or closed.
However, I cannot figure out how in Transcript to add parameters to a call.
So I can do this inside a "tell BBEdit" (all sent via "do ... as applescript):
open "/test.txt"
or this (equivalent)
<<event aevtodoc>> "/test.txt"
or this
open "/test.txt" opening in new_window
or this (equivalent)
<<event aevtodoc>> "/test.txt" opening in new_window
but I can't figure out a syntax to let me add the optional parameter without
using the dictionary, ie something like this should be the equivalent to the
last two above:
<<event aevtodoc>> "/test.txt" <<property OpnI>> new_window
All the variations I've thought of give me a compiler error. So how do I do
that, then?
(Of course, if someone has a stack implementing BBEdit round-trip, that would
answer this question and several others!)
TIA,
Ben Rubinstein | Email: benr_mc at cogapp.com
Cognitive Applications Ltd | Phone: +44 (0)1273-821600
http://www.cogapp.com | Fax : +44 (0)1273-728866
More information about the use-livecode
mailing list