Is there a way to get XY to launch with saved tabs?

Discuss and share scripts and script files...
Post Reply
charles_i
Posts: 37
Joined: 17 Apr 2012 17:06

Is there a way to get XY to launch with saved tabs?

Post by charles_i »

I tend to open a lot of tabs throughout the day which are only used to temporarily copy or move things. I'd like to be able to open XY the next day reverted to my saved tab sets on both the left and right so I don't have to manually do it each time. Is there a script that will do this?

Thanks
Charles

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

Re: Is there a way to get XY to launch with saved tabs?

Post by highend »

Save two tabsets, one for each side and load them via the tabset() command whenever you need | and / or look at the "command line options" in the help file, how to execute a script(-command(s)) when starting XYplorer.
One of my scripts helped you out? Please donate via Paypal

charles_i
Posts: 37
Joined: 17 Apr 2012 17:06

Re: Is there a way to get XY to launch with saved tabs?

Post by charles_i »

I've done the first part -searching for "command line options" brings up way too many pages - I can't find where I would put the code even if I could write it :?

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

Re: Is there a way to get XY to launch with saved tabs?

Post by highend »

...

Let's assume you've saved two tabsets. Left pane = "left". Right pane = "right".

Then you can start XY with:
<path of xyplorer>\XYplorer /script="::tabset('load', 'right', '2'); tabset('load', 'left', '1');"
One of my scripts helped you out? Please donate via Paypal

charles_i
Posts: 37
Joined: 17 Apr 2012 17:06

Re: Is there a way to get XY to launch with saved tabs?

Post by charles_i »

I tried this in Run Script and got the error Overflow 0

C:\Program Files\XYplorer\ /script="::tabset('load', 'right', '2'); tabset('load', 'left', '1');"

Where do I save this to run when the program starts? Can't find anything in Scripts other than Load Script File - do I have to save it to a file? If so what tells it to run when the program starts?

eil
Posts: 1866
Joined: 13 Jan 2011 19:44

Re: Is there a way to get XY to launch with saved tabs?

Post by eil »

charles_i wrote:C:\Program Files\XYplorer\ /script="::tabset('load', 'right', '2'); tabset('load', 'left', '1');"
where is the actual .exe in this line? all this must be put in a shortcut(.lnk file) that will start XYplorer along with a script. ever heard of "launch with parameters"?.
Win 7 SP1 x64 100% 1366x768|1900x1080

charles_i
Posts: 37
Joined: 17 Apr 2012 17:06

Re: Is there a way to get XY to launch with saved tabs?

Post by charles_i »

OK, I get it. I've made .bat files before but never .lnk - and having searched for creating one in Windows 7 I'm not having much luck. So can I put this in the Properties of the Windows shortcut (if so, where? I tried adding the /script part to Target but it didn't work), or do I have to create a special .lnk file (like a .bat), and if so, where can I find instructions on how to do that?

C:\Program Files\XYplorer.exe /script="::tabset('load', 'Right', '2'); tabset('load', 'Left', '1');"

Thanks
Charles

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

Re: Is there a way to get XY to launch with saved tabs?

Post by serendipity »

Well, you have to first create Tabsets called Right and Left from inside XY before you can use the script in XY's shortcut.
After you that as eil mentioned, enter this in the target field of the shortcut:

Code: Select all

"C:\Program Files\XYplorer.exe" /script="::tabset('load', 'Right', '2'); tabset('load', 'Left', '1');"
Note that quotes are required if there are spaces in the file path.

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

Re: Is there a way to get XY to launch with saved tabs?

Post by highend »

This video was captured on a german Win XP but you should get the clue...

http://youtu.be/_8HfeSqZpco
One of my scripts helped you out? Please donate via Paypal

charles_i
Posts: 37
Joined: 17 Apr 2012 17:06

Re: Is there a way to get XY to launch with saved tabs?

Post by charles_i »

Thanks for the video! I created the Left and Right tabsets and saved them before I posted this - no problem there. If I go to "Revert To Saved" they work - however putting this into Target doesn't work - it launches XYplorer OK but doesn't do it with the saved tabs. (Note I named my tabsets with capitals so they are "Right" and "Left".)

"C:\Program Files\XYplorer\XYplorer.exe" /script="::tabset('load', 'Right', '2'); tabset('load', 'Left', '1');"

Charles

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

Re: Is there a way to get XY to launch with saved tabs?

Post by highend »

Upper- or lowercase names for tabsets don't matter.

It seems you have to disable "Save settings on exit" in Configuration - Startup & Exit, otherwise XY stores your last open tabs, regardless if you try to load them on next start.

If you don't want that,
use this command line instead:

Code: Select all

/script="::tabset('revert', 'Right', '2'); tabset('revert', 'Left', '1');"
And if the damn tabsets still refuse to work... you can always use the scripting commands focus() and tab() to recreate the necessary tabs.

E.g.:
Save the following code in the .\Data\Scripts folder in the XY settings folder under e.g. the following name: "load_tabs.xys"
If you're unsure where this path resides, enter <xyscripts> in the address bar of XYplorer. It will take you to that folder.

Code: Select all

// Right pane
	focus("P2");
	tab("new", "D:\ijk");
	tab("closeothers");
	tab("new", "D:\lmn");
	tab("new", "D:\opq");
	seltab 1;

// Left pane
	focus("P1");
	tab("new", "C:\abc");
	tab("closeothers");
	tab("new", "C:\def");
	tab("new", "C:\geh");
	seltab 1;
Just modify the paths and add / delete additional tab("..."); commands as you wish. But please, add or delete only those commands between tab('closeothers') and seltab 1;
Ofc you can change the path for the first tab() command^^

Then you can modify you XYplorer .lnk file to this:

Code: Select all

"C:\Program Files\XYplorer\XYplorer.exe" /script=load_tabs
One of my scripts helped you out? Please donate via Paypal

charles_i
Posts: 37
Joined: 17 Apr 2012 17:06

Re: Is there a way to get XY to launch with saved tabs?

Post by charles_i »

Option #1 worked so I didn't have to go to the script. But good to keep that option available if for some reason I ever want to Save on Exit - but I can't ever see doing that. I think that's a silly menu item. I guess if you were doing a very complicated file manipulation that you didn't get finished - but I think it would be pretty rare.

Thanks for all your help highend. Saves hitting that "revert" button on both panels every morning. 8)

Charles

charles_i
Posts: 37
Joined: 17 Apr 2012 17:06

Re: Is there a way to get XY to launch with saved tabs?

Post by charles_i »

Just one more thing - unless this is a new topic - can I put the "Revert to Saved" script on a button so I don't have to use the dropdown on each panel?

eil
Posts: 1866
Joined: 13 Jan 2011 19:44

Re: Is there a way to get XY to launch with saved tabs?

Post by eil »

yes you can. add user button and put #857 in "On click" row.
Win 7 SP1 x64 100% 1366x768|1900x1080

charles_i
Posts: 37
Joined: 17 Apr 2012 17:06

Re: Is there a way to get XY to launch with saved tabs?

Post by charles_i »

Perfect - thanks!

Post Reply