The devil is in the script details

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

The devil is in the script details

Post 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. :(

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: The devil is in the script details

Post 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.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: The devil is in the script details

Post 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 " ".
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: The devil is in the script details

Post 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.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: The devil is in the script details

Post 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.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: The devil is in the script details

Post 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.

admin
Site Admin
Posts: 66344
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: The devil is in the script details

Post 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."

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: The devil is in the script details

Post 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. :(

Post Reply