Page 1 of 1
[Scripting] "read Tabs header" - "or reuse tab"
Posted: 26 Jun 2009 13:21
by Stefan
How can i reuse an tab?
Like:
IF TabExist Goto
ELSE NewTab & Goto
---------
I use right now:
$LW = "X:"
#340; //new tab
GoTo $LW;
And get always an another Tab with X:\ every time i execute this script.
I want to do:
$LW = "X:"
IF TabExists($LW) Then
GoTo $LW;
ELSE
#340; //new tab
GoTo $LW;
END IF
---
Or maybe even better for more uses read the paths or names in tab header:
While $i < TabCount {
IF substr TabHeader($i), "X:\" Then
//IF substr TabHeader($i), "\review\" Then
break;
End If
incr $i;
}
seltab $i;
What do you think?
Any workaround or hidden command?
Maybe
GoTo $LW, reuse=true;
------- This is the whole script to map an share and open it in new tab:
(This works, but if i execute this script an second time, i want no new tab but reuse existing tab)
$Server = "\\server.de\";
$Share = "share";
$LW = "X:";
While (exists($LW)<2) {
Run ( "cmd /c Net use $LW $Server$Share" );
wait 5000;
#340; //new tab
}
GoTo $LW; // , reuse;
Re: [Scripting] "read Tabs header" - "or reuse tab"
Posted: 26 Jun 2009 13:31
by admin
I'd prefer this one:
GoTo $LW, [reuseexistingtab]
please bump me later...
Re: [Scripting] "read Tabs header" - "or reuse tab"
Posted: 26 Jun 2009 22:41
by admin
admin wrote:I'd prefer this one:
GoTo $LW, [reuseexistingtab]
please bump me later...
BTW, I added it silently in v8.00.0012.

(I was too lazy to write all the documentation...

)
Code: Select all
goto "C:\", 1; //reuse any tab already pointing to "C:\"
Re: [Scripting] "read Tabs header" - "or reuse tab"
Posted: 28 Jun 2009 13:56
by Stefan
admin wrote:BTW, I added it
Thanks

(i can't test right now but i will report later)
$Server = "\\server.de\";
$Share = "share";
$LW = "X:";
While (exists($LW)<2) {
Run ( "cmd /c Net use $LW $Server$Share" );
wait 5000;
#340; //new tab
}
GoTo $LW, 1;
Re: [Scripting] "read Tabs header" - "or reuse tab"
Posted: 20 Jul 2009 17:33
by Stefan
admin wrote:
BTW, I added it silently in v8.00.0012.
Code: Select all
goto "C:\", 1; //reuse any tab already pointing to "C:\"
Thanks Don,
please note that this works only for
path like "C:\" syntax.... but not for
drive like "C:"
And "net use" works as
"net use x:" only, ....
"net use x:\" fails.
So i have to modify my script and add an backslash to the last use of the $LW var ==> "
GoTo $LW\, 1; "
Code: Select all
$Server = "\\server.de\";
$Share = "share";
$LW = "X:";
While (exists($LW)<2) {
Run ( "cmd /c Net use $LW $Server$Share" );
wait 5000;
#340; //new tab
}
GoTo $LW\, 1;
This works fine, thank you.
Additional wish:
Problem:
If there is no tab to reuse i would overwrite an existing tab.
I found no scripting way to determine if an tab exists or not.
So may i ask for an another parameter
"force new tab IF reuse not possible" like
Code: Select all
GoTo C:\; // overwrite existing tab
#340; GoTo C:\; // new tab
GoTo C:\, 1; // reuse existing tab
GoTo C:\, 2; // reuse existing tab if already exists, otherwise create new tab
Or is there an better way?
Maybe like an additional
exists() option like
0 = does not exist
1 = exists (file)
2 = exists (folder; drive; share; server)
3 = exists (tab)
I think this is of more generic use?
Re: [Scripting] "read Tabs header" - "or reuse tab"
Posted: 01 Aug 2009 14:38
by admin
Stefan wrote:admin wrote:
BTW, I added it silently in v8.00.0012.
Code: Select all
goto "C:\", 1; //reuse any tab already pointing to "C:\"
Thanks Don,
please note that this works only for
path like "C:\" syntax.... but not for
drive like "C:"
And "net use" works as
"net use x:" only, ....
"net use x:\" fails.
So i have to modify my script and add an backslash to the last use of the $LW var ==> "
GoTo $LW\, 1; "
Code: Select all
$Server = "\\server.de\";
$Share = "share";
$LW = "X:";
While (exists($LW)<2) {
Run ( "cmd /c Net use $LW $Server$Share" );
wait 5000;
#340; //new tab
}
GoTo $LW\, 1;
This works fine, thank you.
Additional wish:
Problem:
If there is no tab to reuse i would overwrite an existing tab.
I found no scripting way to determine if an tab exists or not.
So may i ask for an another parameter
"force new tab IF reuse not possible" like
Code: Select all
GoTo C:\; // overwrite existing tab
#340; GoTo C:\; // new tab
GoTo C:\, 1; // reuse existing tab
GoTo C:\, 2; // reuse existing tab if already exists, otherwise create new tab
Or is there an better way?
Maybe like an additional
exists() option like
0 = does not exist
1 = exists (file)
2 = exists (folder; drive; share; server)
3 = exists (tab)
I think this is of more generic use?
Hmm, thanks, but a touch too much for my taste at the moment.
I'll check that C: vs C:\ issue...