From: Jim I. <ji...@ap...> - 2002-03-12 21:54:29
|
On 3/12/02 12:31 PM, "Bernard Desgraupes (by way of Jon Guyer)" <bde...@ea...> wrote: > [Originally reported to alphatcl-developers]: > > > Hello, > > I'm currently developping an AppleScript Menu and enhancing the > AppleScript mode for > Alpha8 : everything goes fine except for two problems (a bug and a > mistake) I have found > in the Tclapplescript shared library. I'm not sure if this is the > right place to report > them, so I'll mention them here and please forward them or tell me > whom I should send them > to. > This is the right place... > Here are the two problems > 1- this is with the "AppleScript execute" command. When the first > two characters of your > script are a comment sign (double dash) the interpreter gets confused > and thinks it is an > option : it sends an error message : > "Error, no value given for switch etc," followed by the entire text > of your script. > To avoid this, the code for the tclOSAExecuteCmd (in tclMacOSA.c) > should be made more > robust. To tell the truth I don't really see the necessity of a check > for an "--" option > since this command doesn't have any switch. Yes it does, it takes the -context switch. You can say: AppleScript execute -context contextToken <Some Script Data> And then the script will get executed in the context represented by contextToken. So the -- is necessary. I guess we could be a little fancier, and if there is ONLY one argument, then assume that that is script data. Tcl doesn't usually do this sort of second-guessing, however... > Anyway, as a temporary and very simple workaround in my Tcl code, I > have inserted a blank > space at the beginning of the text of the script I transmit to > "AppleScript execute" : > proc Scrp::doExecute {text} { > AppleScript execute " $text" > } > > 2- Not really a bug, just a mistake in the doc. It says that the > syntax to delete a > context is > AppleScript delete scriptName > > This is not true. The syntax must be > AppleScript delete what scriptName > > where 'what' is either "context" or "script". > Thanks. Jim -- ++=++=++=++=++=++=++=++=++=++=++=++=++=++=++=++=++=++=++= Jim Ingham ji...@ap... Developer Tools - gdb |