How to define a "popup input box" before running a tool ?

Help with setting up and configuring custom user tools in UltraEdit (based on command line input)

How to define a "popup input box" before running a tool ?

Postby Joggi » Fri Apr 11, 2008 5:17 am

We are using the "tool configuration" option to run a batch file which deploy the selected pl/sql file on the database.

The command line for this tool is : D:\MyPath\deploy.bat %n

The batch file includes the whole database connection settings (user/pass@schema).
Is it possibe to set the connection settings in a "popup input box" with a OK/Cancel option before runnig the batch file ?

Thanks for your help
Joggi
User avatar
Joggi
Newbie
 
Posts: 3
Joined: Fri Apr 11, 2008 4:52 am
Location: Germany

Re: How to define a "popup input box" before running a tool ?

Postby pietzcker » Fri Apr 11, 2008 5:53 am

I'm not sure from your description if the command line parameter %modify% would work for you. This allows you to edit the command line before actually running it.

Or do you need to automatically edit the batch file itself that you're about to run, just before you run it?
User avatar
pietzcker
Master
Master
 
Posts: 241
Joined: Sun Aug 22, 2004 11:00 pm

Re: How to define a "popup input box" before running a tool ?

Postby Joggi » Fri Apr 11, 2008 7:11 am

I know the %modify% option but for me it is not a real solution.
I use it when I commit files into the cvs repository: cvs commit -m %modify% %N%E.
The problem is that when you are using the %modify% option you see the completely
command line data like: "D:\MYPathIsVeryVeryLong\AndIHaveToFindTheModifyPlaceInTheInputbox\test.bat MyFile.sql
in the input box.

I want just input the database login/connection data into the input box and "give it" to the batch file.
But editing the batch file before I run it is also a good idea, but I still need the "input box" for setting the database connections.

Thanks
Joggi
User avatar
Joggi
Newbie
 
Posts: 3
Joined: Fri Apr 11, 2008 4:52 am
Location: Germany

Re: How to define a "popup input box" before running a tool ?

Postby jorrasdk » Fri Apr 11, 2008 7:42 am

You write nothing about which UE version you use, but if it is UE13 or higher you could use a script.

The script command for "popup info box" is
var myToolParms = UltraEdit.getString("Enter tool parms",1);

In the thread "Open UCL from script" there is an example on how to invoke a user tool with parameters set in the script itself. Integrate UltraEdit.getString into this. I'm not gonna create a working example as I do not know if it at all is relevant if you are using a pre UE13 version.
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: How to define a "popup input box" before running a tool ?

Postby Joggi » Fri Apr 11, 2008 8:32 am

Sorry, you are right I forget to specify the UE version which is 12.10a.
User avatar
Joggi
Newbie
 
Posts: 3
Joined: Fri Apr 11, 2008 4:52 am
Location: Germany

Re: How to define a "popup input box" before running a tool ?

Postby Mofi » Sun Apr 13, 2008 7:49 am

It would be possible to run a tool with a macro and use macro command GetString for the optional parameters. The problem is that the macro engine does not support variables. The string entered in the dialog is inserted at the current cursor position into the active file and this will be not what you want. Also you need to select the entered string and run the tool with command line parameter %sel%. So this solution is not really practicable.

What about entering the optional parameters in the batch file itself?

You could run the batch file with option "Show DOS Box" enabled in the tool configuration.

Inside the batch file use following:

set userpw=
set /p userpw=Enter user name and password:

to be able to enter the user name and the password and apply it to environment variable userpw which you can use further.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Custom User Tools/Tool Configuration