Page 1 of 1
The devil is in the script details
Posted: 30 Sep 2009 17:05
by aurumdigitus
Implemented an apple pie simple script that works fine:
openwith """C:\WINDOWS\system32\sdelete.exe"" -p 2 -s <items>", m
After quickly shooting self in foot changed it to:
msg "Are you absolutely sure?", 1;
openwith """C:\WINDOWS\system32\sdelete.exe"" -p 2 -s <items>", m
Now it no longer functions and am embarrassed to admit that is such a paucity of code the syntax error eludes.

Re: The devil is in the script details
Posted: 30 Sep 2009 17:53
by serendipity
aurumdigitus wrote:Implemented an apple pie simple script that works fine:
openwith """C:\WINDOWS\system32\sdelete.exe"" -p 2 -s <items>", m
After quickly shooting self in foot changed it to:
msg "Are you absolutely sure?", 1;
openwith """C:\WINDOWS\system32\sdelete.exe"" -p 2 -s <items>", m
Now it no longer functions and am embarrassed to admit that is such a paucity of code the syntax error eludes.

Strange, I copy/pasted your code and ran it from menu| Scripting| Try script and it does work for me.
Re: The devil is in the script details
Posted: 30 Sep 2009 18:06
by zer0
Without calling you stupid, may I ask if you created a space on your 2nd script line? So your script should be:
Code: Select all
msg "Are you absolutely sure?", 1;
[space]openwith """C:\WINDOWS\system32\sdelete.exe"" -p 2 -s <items>", m
with the [space] obviously representing " ".
Re: The devil is in the script details
Posted: 30 Sep 2009 18:19
by serendipity
zer0 wrote:Without calling you stupid, may I ask if you created a space on your 2nd script line? So your script should be:
Code: Select all
msg "Are you absolutely sure?", 1;
[space]openwith """C:\WINDOWS\system32\sdelete.exe"" -p 2 -s <items>", m
with the [space] obviously representing " ".
No, space is necessary here. Every line (except menu captions in script files) should start with a space.
Re: The devil is in the script details
Posted: 30 Sep 2009 19:12
by aurumdigitus
By gosh and golly the "space" did it!
Not arguing with success but in a multiline script doesn't the trailing semicolon obviate the need for a space or tab?
To up the ante, how is it that
serendipity gets it working without one. Somewhere here lurks a discrepancy.
Re: The devil is in the script details
Posted: 30 Sep 2009 19:18
by TheQwerty
aurumdigitus wrote:Not arguing with success but in a multiline script doesn't the trailing semicolon obviate the need for a space or tab?

Then how does XY know when that script ends and another begins? Remember that the "Caption|Icon|State : Label" is entirely optional. But yes, Don's been contemplating how he's going to change things (probably using {} for blocks) to eliminate the white-space dependency.
Re: The devil is in the script details
Posted: 30 Sep 2009 19:50
by admin
aurumdigitus wrote:By gosh and golly the "space" did it!
Not arguing with success but in a multiline script doesn't the trailing semicolon obviate the need for a space or tab?
To up the ante, how is it that
serendipity gets it working without one. Somewhere here lurks a discrepancy.
I think here lurks a misunderstanding:
serendipity said: "No, space is necessary here."
serendipity said not: "No space is necessary here."
Re: The devil is in the script details
Posted: 30 Sep 2009 20:03
by aurumdigitus
Site Admin wrote:I think here lurks a misunderstanding:
serendipity said: "No, space is necessary here."
serendipity said not: "No space is necessary here."
Hummmm. Time for new spectacles and/or new cerebral cortex.
