Expandable drive button

Discuss and share scripts and script files...
Filehero
Posts: 2713
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Expandable drive button

Post by Filehero »

Marco wrote:Also, an external script executor like XYcopy would be a killer feature for scripters... :whistle: ...
Co-introduction of UDFs (user defined functions) would make that a SKF (super killer feature). :whistle: :whistle:


Cheers,
Filehero

PS: Has the 'Cavaliere' faced the final curtain today?

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

Re: Expandable drive button

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

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

Re: Expandable drive button

Post by serendipity »

Move post to first page.
Last edited by serendipity on 04 Oct 2013 20:42, edited 4 times in total.

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: Expandable drive button

Post 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

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

Re: Expandable drive button

Post by serendipity »

klownboy wrote:...but you can use the "no show" parameter.
Ken
Duuh... how stupid of me. :whistle:
I never thought of that!
Thanks to you!! for getting rid of that black box.

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

Re: Expandable drive button

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

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

Re: Expandable drive button

Post by serendipity »

Updated first post.

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Re: Expandable drive button

Post by nerdweed »

Filehero wrote:
Marco wrote:Also, an external script executor like XYcopy would be a killer feature for scripters... :whistle: ...
Co-introduction of UDFs (user defined functions) would make that a SKF (super killer feature). :whistle: :whistle:


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

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

Re: Expandable drive button

Post 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

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

Re: Expandable drive button

Post by serendipity »

updated first post, v2 released.

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

Re: Expandable drive button

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

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

Re: Expandable drive button

Post by admin »

Oh. :whistle: 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.

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

Re: Expandable drive button

Post by serendipity »

admin wrote:Oh. :whistle: 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.

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

Re: Expandable drive button

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

Filehero
Posts: 2713
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Expandable drive button

Post 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

Post Reply