Script popup instead of running

Discuss and share scripts and script files...
Post Reply
e-volusian
Posts: 1
Joined: 06 Apr 2016 15:09

Script popup instead of running

Post by e-volusian »

Hey all, I use xyplorer every day but never got into the scripting. Am now trying this very simple script:

Code: Select all

$orig_path=<curpath>
msg $orig_path
I save this as:

C:\Users\me\AppData\Roaming\XYplorer\Scripts\test.xys

Then type:

::load "test.xys";

In xyplorer address bar.

Expected result: a message box that says the current path.

Actual result: a popup with two lines that are each of the two lines of the script. I can click on each of those lines and it seems to execute that line only.

This seems to me like it might be the result of "Step Mode" however Step Mode is definitely NOT turned on (no check next to it in the Scripting menu-bar drop-down).

What am I doing wrong?

[mod edit: title adapted, script in code blocks]

highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Very newbie question - script popup instead of running

Post by highend »

Welcome to the club.

1. Script commands generally end with ";"
2. Scripts needed to be indented
So, e.g. indent both lines by e.g. 4 spaces (at least one space or tab, while the first script command line doesn't need to be indented. And there are a few other exceptions (read the help file for more details, especially on multi-line scripts, labels...)

E.g.:

Code: Select all

$orig_path=<curpath>;
    msg $orig_path;
One of my scripts helped you out? Please donate via Paypal

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Script popup instead of running

Post by bdeshi »

highend wrote:E.g.:

Code: Select all
$orig_path=<curpath>;
msg $orig_path;
Rather, it looks better if the first line of a script is also indented.

Code: Select all

    $orig_path=<curpath>;
    msg $orig_path;
You should separate different scripts with labels.

Code: Select all

"script 1"
    $orig_path=<curpath>;
    msg $orig_path;
"script 2"
    $orig_file=<curitem>;
    msg $orig_file;
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply