Page 1 of 1

Script to open new tab and select some folders

Posted: 24 Jun 2012 07:43
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

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 08:12
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

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 08:54
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.

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 09:05
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:

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 09:10
by plorerer
thank you all.
i learned the indent thing today from you.

and found out that i must use
selectitems

instead of sel.

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 10:12
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?

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 10:17
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.

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 10:27
by highend
And the target program is...?

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 10:29
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.)

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 12:24
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 ;)

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 12:36
by admin
Dem Ingeniör ist nichts zu schwör. :)

Re: Script to open new tab and select some folders

Posted: 24 Jun 2012 21:06
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>"