Multiple Tab Locations based on a user defined variable?

Discuss and share scripts and script files...
Post Reply
igl007
Posts: 2
Joined: 04 Dec 2009 23:45

Multiple Tab Locations based on a user defined variable?

Post by igl007 »

Sorry if this has been asked before. I did a search but couldn't find anything.
What I am trying to do is have a dialog box appear where the user can type a variable in like say Moonrise They click ok and then a pre-determined number of tabbed locations would open pointing to set folder structures like this:

C:\footage\Moonrise
I:\graphics\Moonrise
X:\temp\seasonal\Moonrise
E:\george\killer\Moonrise

and so on...

Is that possible?

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Multiple Tab Locations based on a user defined variable?

Post by zer0 »

If you know the locations to be opened for a particular variable that you type then sure, it's possible. The code for your example would be

Code: Select all

$a = input("Enter Variable Name");
   if $a == "Moonrise" {
   #340;
   goto "C:\footage\Moonrise";
   #340;
   goto "I:\graphics\Moonrise";
   #340;
   goto "X:\temp\seasonal\Moonrise";
   #340;
   goto "E:\george\killer\Moonrise";
   }
   elseif $a == "Another variable" {
   #340;
   goto "PATH";
   ...
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

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

Re: Multiple Tab Locations based on a user defined variable?

Post by admin »

Hi and welcome,

What do you mean by "tabbed locations"?

Don

igl007
Posts: 2
Joined: 04 Dec 2009 23:45

Re: Multiple Tab Locations based on a user defined variable?

Post by igl007 »

zer0 wrote:If you know the locations to be opened for a particular variable that you type then sure, it's possible. The code for your example would be

Code: Select all

$a = input("Enter Variable Name");
   if $a == "Moonrise" {
   #340;
   goto "C:\footage\Moonrise";
   #340;
   goto "I:\graphics\Moonrise";
   #340;
   goto "X:\temp\seasonal\Moonrise";
   #340;
   goto "E:\george\killer\Moonrise";
   }
   elseif $a == "Another variable" {
   #340;
   goto "PATH";
   ...
Thanks for the reply. I tried some your code which helped me go further in the right direction. I am still unsure on a couple of things. I don't think i need a if/then though. IDK...
I revised the code to make it do what I want, but it's not. :( I don't know how to make the final directory in the goto statement be the inputed name that the user typed. Here is what i tried...

$a = input("Enter Client Name");
#340
goto "C:\George\$a";

Hopefully that makes sense

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Multiple Tab Locations based on a user defined variable?

Post by zer0 »

Below is the correct code:

Code: Select all

$a = input("Enter Client Name");
  #340;
  goto C:\$a;
Yours was almost right, save for a missing semicolon and quotation marks that shouldn't have been there, because otherwise XY couldn't interpret your variable $a.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

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

Re: Multiple Tab Locations based on a user defined variable?

Post by admin »

zer0 wrote:Below is the correct code:

Code: Select all

$a = input("Enter Client Name");
  #340;
  goto C:\$a;
Yours was almost right, save for a missing semicolon and quotation marks that shouldn't have been there, because otherwise XY couldn't interpret your variable $a.
No no, don't teach the wrong lessons! :P Quotation marks should be around every string! The variable $a is interpolated (check Help).

So this is okay:

Code: Select all

$a = input("Enter Client Name");
  #340;
  goto "C:\$a";

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Multiple Tab Locations based on a user defined variable?

Post by zer0 »

My bad :oops: So it was only the missing semicolon that was causing problems, you little bugger :mrgreen: Interpolation was an interesting read :idea:
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Post Reply