Throw-away clone script

Things you’d like to miss in the future...
Post Reply
Daniel0312
Posts: 154
Joined: 15 Feb 2016 10:48

Throw-away clone script

Post by Daniel0312 »

I want to run a long task in the background while I continue using XY.

The following code ONLY works if the $Scripfile is situated in the main instance script folder and with full path.

Code: Select all

  $cmd = <<<>>>
"<xy>" /new /readonly /win=normal /script="$ScriptFile"
    >>>;
  run $cmd, "%TEMP%", 2;
$ScriptFile = "LongTask.xys" » no OK
$ScriptFile = "C:\Users\Daniel\Desktop\LongTask.xys" » no OK
$ScriptFile = "<xyscripts>\LongTask.xys" » OK

Is it a bug or is there (again) something I don't understand ?
Daniel
Windows7 SP1 x64 / XY latest stable

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

Re: Throw-away clone script

Post by admin »

" and with full path." but later you say "no OK" at full path?

Daniel0312
Posts: 154
Joined: 15 Feb 2016 10:48

Re: Throw-away clone script

Post by Daniel0312 »

What I meant was that it's only OK with full path given AND if this path is the original XY script folder
Daniel
Windows7 SP1 x64 / XY latest stable

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

Re: Throw-away clone script

Post by admin »

Confusing. Show the complete script.

Daniel0312
Posts: 154
Joined: 15 Feb 2016 10:48

Re: Throw-away clone script

Post by Daniel0312 »

hum...
This is just a test script I arrived at after trying for a very long time to understand why my real case wasn't working as expected, and you've got it right here ! But you were right to ask for the full script !
It seems the problem is with an INCLUDE statement at the beginning of my real case "LongTask" script file.

Code: Select all

INCLUDE 'inc\Tools.xyi'
Replacing the line with

Code: Select all

INCLUDE 'E:\Partage\Mes Programmes\XYplorer\XYdata\!Scripts\Inc\Tools.xyi'
solved it.
I guess this has something to do with relative paths, and the fact that my XY folder structure isn't the default one.
The "longTask" script is actually looking for the included file in "E:\Partage\Mes Programmes\XYplorer\Data\Scripts\inc", the "default" location, when it actually in "E:\Partage\Mes Programmes\XYplorer\XYdata\!Scripts\Inc".

When it isn't found, the script just stops loading (or so it seems) and no further lines are read.
Not sure there is something really wrong there.
Daniel
Windows7 SP1 x64 / XY latest stable

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

Re: Throw-away clone script

Post by admin »

Can't tell from here, but it shouldn't be too hard to add some test lines to the script to find out what you want to know.

Daniel0312
Posts: 154
Joined: 15 Feb 2016 10:48

Re: Throw-away clone script

Post by Daniel0312 »

Well... a little scripting and I've found a way :)
But I feel that not finding an included file should display an error message, or at least not prevent the excecution of the rest of the script : if there's something missing the script itself will generate an error.
Thank you for taking the time.
Daniel
Windows7 SP1 x64 / XY latest stable

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

Re: Throw-away clone script

Post by admin »

It normally displays an error message, but sometimes (I haven't fully understood this yet) the error messages don't appear at startup when the main window is still invisible.

Daniel0312
Posts: 154
Joined: 15 Feb 2016 10:48

Re: Throw-away clone script

Post by Daniel0312 »

Now I know, next time I'll get it faster :)
Thanks again
Daniel
Windows7 SP1 x64 / XY latest stable

Post Reply