Page 1 of 1

Getting Tool Parameters

Posted: Thu Apr 15, 2004 5:44 pm
by textpadfan
For a custom Tool I wrote, I'd like to:

(1) Use the selected text as the parameter (using $Sel).
OR
(2) Prompt the user for the value if nothing is selected (using $Prompt).

Is there a way to define a Tool Parameter to be something like:

if ($Sel == null) then $Prompt(Enter value:) else $Sel

Posted: Fri Apr 16, 2004 5:47 am
by CyberSlug
You need to use a scripting language such as AutoIt v3 to do that. Here's one way:

Command: AutoIt3.exe foo.au3
Parameters: $Sel
Initial Folder: $FileDir

Code: Select all

;Contents of foo.au3
; Only run your tool if $SEL or the text the user provides is not null
$text = $CmdLine[1]
$text = "" Then $text = InputBox("Title", "Enter value:)
If $text <> "" Then Run("C:\somePath\yourTool.exe")