Script to open new tab and select some folders

Discuss and share scripts and script files...
Post Reply
plorerer
Posts: 4
Joined: 24 Jun 2012 07:38

Script to open new tab and select some folders

Post by plorerer »

hi
i want to open new tab and select some folders
my code is as follows:

tab("new","E:\path\dir1\");
sel "[folder2]";
sel "[folder3]";

but when i run this a popup comes up showing this code and does nothing !:
Image

please help me .
what should i do ? what is the correct code?

thanks in advance

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

Re: Script to open new tab and select some folders

Post by Filehero »

You have to indent the non-first lines for plain script code, just like

Code: Select all

tab("new","E:\path\dir1\");
  sel "[folder2]";
  sel "[folder3]";
instead of

Code: Select all

tab("new","E:\path\dir1\");
sel "[folder2]";
sel "[folder3]";
Unintended (and uncommented) lines are interpreted as menu entries.


You'll find more information in the help section Advanced topics/Scripting.


Cheers,
Filehero

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

Re: Script to open new tab and select some folders

Post by admin »

To put it in other words:

(a) In a multi-line script all lines apart from the first line have to be indented by at least one space.

(b) Each non-indented line is interpreted as the first line of a separate script, and if there are more than one scripts in a loaded script resource then a menu is popped where you can select the script to run.

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

Re: Script to open new tab and select some folders

Post by Filehero »

admin wrote:(b) Each non-indented line is interpreted as the first line of a separate script, and if there are more than one scripts in a loaded script resource then a menu is popped where you can select the script to run.
The description I failed to find. One coffee seems to be insufficient on a cloudy sunday morning .... :lol:

plorerer
Posts: 4
Joined: 24 Jun 2012 07:38

Re: Script to open new tab and select some folders

Post by plorerer »

thank you all.
i learned the indent thing today from you.

and found out that i must use
selectitems

instead of sel.

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

Re: Script to open new tab and select some folders

Post by admin »

plorerer wrote:thank you all.
i learned the indent thing today from you.

and found out that i must use
selectitems

instead of sel.
Correct.

I wonder what your script intends to do. Select some folders? And then? What's your plan?

plorerer
Posts: 4
Joined: 24 Jun 2012 07:38

Re: Script to open new tab and select some folders

Post by plorerer »

select some folders
then i want to drag drop them to other program

i am stuck in the drag drop phase
(i have 80 tabs in XYP and there are selected folders in each tab)
do you have any suggestion ?

i thought maybe if i catalog the selected folders then i can do something...
but it seems that it is not possible to drag drop folders from a catalog to other program.

any advice would be appreciated.
thanks.

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

Re: Script to open new tab and select some folders

Post by highend »

And the target program is...?
One of my scripts helped you out? Please donate via Paypal

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

Re: Script to open new tab and select some folders

Post by admin »

If you want to open those folders with another program you can do so directly using e.g. scripting command openwith. No need to go there and select them first.

(Sorry, I have to go now.)

plorerer
Posts: 4
Joined: 24 Jun 2012 07:38

Re: Script to open new tab and select some folders

Post by plorerer »

well i used some engineering skills :D

i tag the needed folders
then i search the root directory for tagged folders
then all the wanted folders are shown altogether
and i can easily select all and drag drop ;)

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

Re: Script to open new tab and select some folders

Post by admin »

Dem Ingeniör ist nichts zu schwör. :)

pqalmz
Posts: 14
Joined: 04 Jan 2011 11:14

Re: Script to open new tab and select some folders

Post by pqalmz »

This is some of the easiest job, which can be done by .bat file with content

Code: Select all

"<path to program folder>\<program>.exe" "<folder1 path>" "<folder2 path>"

Post Reply