From: Bernard D. <bde...@ea...> - 2002-03-12 23:22:05
|
Jim Ingham wrote: > On 3/12/02 12:31 PM, "Bernard Desgraupes (by way of Jon Guyer)" > <bde...@ea...> wrote: > > > > 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> > Oh, that's right, sorry, I was too quick. There still is this risk of a clash between "--" as a switch and "--" as a comment sign at the beginning of an AppleScript script. This means that we should _always_ use the -- switch in "AppleScript execute" to be safe. Cheers Bernard |