Syntax to add parameters not in the dictionary (BBEdit roundtrip)

I have an immediate challenge, which is the current roadblock on the way to my bigger challenge. I’d appreciate assistance with either.

I want to use BBEdit’s “Roundtrip” ODB functionality: this allows an application to instruct BBEdit to edit a document, and to notify the original application when the user saves or closes the document. You get this functionality by sending an extra parameter (your application’s signature) with the open command. More details here: http://www.barebones.com/support/develop/odbsuite.shtml.

However, this extra parameter is not in BBEdit’s dictionary, so I need to figure out how to send it, given the code. If I was writing in C or similar, that would be fine; construct the ‘odoc’ event, add parameters to it, etc. But I need to do this using AppleScript. Apart from the fact that I haven’t yet found the code for this parameter, I also can’t figure out the syntax for sending a parameter using the ‘AppleEvent’ codes rather than the ‘AppleScript’ names.

So my immediate challenge is just that. I’ve been trying to work with a command that is in the dictionary, to isolate the syntax issue. I can do this:

and I can do this, which is equivalent:

And I can also do this:

or even this, which is equivalent:

but I can’t figure out the syntax to do something like this, which should be equivalent:


If anyone can help me with this (or provide any other tips) I’d be most grateful.

  • Ben
«event aevtodoc» "/test.txt" given «class OpnI»:new_window

HTH

Thank you! That got me there.

(For anyone who Googles across this going down the same route as me: the next problem I had was finding the code referred to in the BBEdit documentation as ‘keyServerID’, but which doesn’t seem to be defined anywhere. It turns out that you really want keyFileSender, which is “FSnd”.)