Page 2 of 8
Re: Expandable drive button
Posted: 02 Oct 2013 20:13
by Filehero
Marco wrote:Also, an external script executor like XYcopy would be a killer feature for scripters...

...
Co-introduction of UDFs (
user defined functions) would make that a SKF (
super killer feature).
Cheers,
Filehero
PS: Has the 'Cavaliere' faced the final curtain today?
Re: Expandable drive button
Posted: 02 Oct 2013 20:32
by TheQwerty
Marco wrote: However, be ready to spend a considerable amount of time debugging your Run command to get the correct magical incantation of correctly escaped quotes. (I've attempted it and failed thus far.)
Have you tried heredoc?
I did not, and I quit playing with this after posting.
It's a problem of all the places that are caring about quotes and spaces there.
1) XY in the run command's arguments.
2) schtasks in /TR's additional parameter.
3) XY in the /script= parameter.
I think the easiest thing to do would be to have the original script write a batch file that opens XY with the secondary script and then run schtasks and use that batch file as the /TR parameter.
And maybe even have that secondary script be a script file itself to simplify what is being passed into XY on the command line.
-----
Another alternative is to just write a simple script that executes commands found in an INI file or something and create a scheduled task to run it in XY every n minutes.
Then the original script could "register" it's secondary script with the recurring script and it would be run whenever the scheduled task next ran the recurring script.
-----
All of this said...
Truth be told I'm leary of using XY scripting with scheduled tasks as I once had a task set up to run the following periodically:
Code: Select all
XYplorer.exe /script="::SaveSettings;"
I came back after a long weekend to find my machine nearly unresponsive due to the many hundred instances of xyplorer.exe that were running.
I'm not sure what the failure was, or if anyone but myself was to blame, but that was the end of that experiment for me.

Re: Expandable drive button
Posted: 02 Oct 2013 22:07
by serendipity
Move post to first page.
Re: Expandable drive button
Posted: 04 Oct 2013 18:52
by klownboy
Wow serendipity,
I can't believe no one has commented on your script. Very slick whether you use the timing feature or not. Maybe people don't realize you can use this script for just about any modification of your toolbar not just for adding drives as in the original purpose. For example, I used it to add a few different CTBs that I don't use that often like this:
Code: Select all
$newtoolbar=replace($toolbar,"$curctb","$curctb,ctb16,ctb17,ctb18,-") ;
I also added the switches on to the end of the run command to hide the command window.
Code: Select all
run "cmd /c ping -n $userwaittime 127.0.0.1 >nul & cd /d <xypath> & xyplorer.exe /script=""::load 'ExpandDriveButton.xys','_Autoclose'"" /flg=2", , 0,0;
It works great. You can't use the "wait" parameter obviously, or the added CTBs are inoperative in the time set, but you can use the "no show" parameter.
I'm in the process of tweaking it to add one set of CTBs when you normal left click and another set of CTBs when you right click using the get trigger command making it even more useful.
Once again, thank you.
Ken
Re: Expandable drive button
Posted: 04 Oct 2013 19:03
by serendipity
klownboy wrote:...but you can use the "no show" parameter.
Ken
Duuh... how stupid of me.
I never thought of that!
Thanks to you!! for getting rid of that black box.
Re: Expandable drive button
Posted: 04 Oct 2013 19:06
by serendipity
klownboy wrote:I'm in the process of tweaking it to add one set of CTBs when you normal left click and another set of CTBs when you right click using the get trigger command making it even more useful.
Ken
Yeah, it's handy isn't it? having different sets of icons appear with left or right click?
Already have couple of them here.

Re: Expandable drive button
Posted: 04 Oct 2013 20:46
by serendipity
Updated first post.
Re: Expandable drive button
Posted: 04 Oct 2013 22:52
by nerdweed
Filehero wrote:Marco wrote:Also, an external script executor like XYcopy would be a killer feature for scripters...

...
Co-introduction of UDFs (
user defined functions) would make that a SKF (
super killer feature).
Cheers,
Filehero
PS: Has the 'Cavaliere' faced the final curtain today?
We have kind of UDFs
Create functions in small script files (or single file) and load them. Pass parameters through Permanent Variables.
At times, I hence wish for Session variables (only available for that session), because some PVs, I wish to save through multiple sessions and others I don't.
So, using unset for the PVs, I don't want to save
Re: Expandable drive button
Posted: 05 Oct 2013 09:27
by admin
You can use a 2nd instance of XY as external script executor already now.
Code: Select all
v10.40.0115 - 2011-10-25 14:22
+ Command Line Switches: Now you can feed a script into an existing
instance of XYplorer without changing the location or tabs of that
instance. Simply pass the new switch /flg=2 in the command line,
for example:
E:\XY\XYplorer\XYplorer.exe /script="::msg 'Hi!';" /flg=2
Re: Expandable drive button
Posted: 05 Oct 2013 09:30
by serendipity
updated first post, v2 released.
Re: Expandable drive button
Posted: 05 Oct 2013 09:31
by serendipity
admin wrote:You can use a 2nd instance of XY as external script executor already now.
Code: Select all
v10.40.0115 - 2011-10-25 14:22
+ Command Line Switches: Now you can feed a script into an existing
instance of XYplorer without changing the location or tabs of that
instance. Simply pass the new switch /flg=2 in the command line,
for example:
E:\XY\XYplorer\XYplorer.exe /script="::msg 'Hi!';" /flg=2
Yes, I already use /flg=2 in the run command.
Or do you mean something else?
Re: Expandable drive button
Posted: 05 Oct 2013 09:37
by admin
Oh.

You know, I don't have the time to read all scripts posted here. I just pop a quick note if something strikes my mind.
Re: Expandable drive button
Posted: 05 Oct 2013 09:41
by serendipity
admin wrote:Oh.

You know, I don't have the time to read all scripts posted here. I just pop a quick note if something strikes my mind.
Thanks for checking! indeed my first script did not have this, I added the /flg thing only later.
Re: Expandable drive button
Posted: 05 Oct 2013 09:44
by admin
And I actually had meant this as a reply to Marco:
Marco wrote:Also, an external script executor like XYcopy would be a killer feature for scripters...

...
Re: Expandable drive button
Posted: 05 Oct 2013 10:26
by Filehero
nerdweed wrote:We have kind of UDFs
Create functions in small script files (or single file) and load them. Pass parameters through Permanent Variables.
At times, I hence wish for Session variables (only available for that session), because some PVs, I wish to save through multiple sessions and others I don't.
To make this "kind of UDFs" obsolete is exactly why I was mentioning UDFs. BTW, Global Variables should be sufficient most of the time.
But this is getting too much OT here.
Cheers,
Filehero