Hi Guys :
I'm using Msched 7.4. Is there a way to change the title of the Input window when your selecting files. I have a Browse button connected to a SRT with an Input command in it. But when I click on browse the title of the Window says " Macro Scheduler Input" any way to change that title in 7.4???
Input Command Caption Title
Moderators: Dorian (MJT support), JRL
-
- Junior Coder
- Posts: 36
- Joined: Fri Oct 12, 2007 5:55 pm
- Location: federal way wa
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
No.
In later versions the caption can be changed but only for compiled macros.
In later versions you can also create your own custom dialogs - with full control over their appearance. So you could replicate the Input browse dialog and make it look however you wish it to look including the caption.
In later versions the caption can be changed but only for compiled macros.
In later versions you can also create your own custom dialogs - with full control over their appearance. So you could replicate the Input browse dialog and make it look however you wish it to look including the caption.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi MacschedStudent,
Do you have the compiler? If you do and you are willing to run your macro compiled, then just add the following line near the top of your script:
Then instead of "Macro Scheduler Input", the title will be "myApp Input".
Note that this isn't a "total" title changing solution because you can't get rid of the "Input" part with this method.
If you want a brute force method using a Win API call, here's a way:
While the above can work, I wouldn't recommend it in your case because:
Instead you could create your own custom dialog which means:
...and that's why, long ago, I felt that the Input> command could have been enhanced to add one more optional parameter so we could specify a title if desired, like this:
Now here's something that Input> may not be able to do:
It returns exactly the same thing... the variable will contain an empty string.
The problem is, I want to do two different things:
Question for Marcus: If there is no way, could this please be added to the wish list?
Thanks for listening and take care
Do you have the compiler? If you do and you are willing to run your macro compiled, then just add the following line near the top of your script:
Code: Select all
Let>APP_TITLE=myApp
Note that this isn't a "total" title changing solution because you can't get rid of the "Input" part with this method.
If you want a brute force method using a Win API call, here's a way:
Code: Select all
//make sure the window you want to change the title on has focus
SetFocus>Macro Scheduler Input
//You need to get the handle not the title (you already know the title)
//setting this will make GetActiveWindow> return the window handle
Let>WIN_USEHANDLE=1
GetActiveWindow>hwnd,X,Y,Width,Height
//now the variable hwnd contains the window handle
//setting this back to default is good practice
Let>WIN_USEHANDLE=0
Let>myTitle=Anything I Jolly Well Want It To Say
//Rename the window
LibFunc>User32,SetWindowTextA,r,hwnd,str:%myTitle%
- for this code to work, the Input> window has to already exist because you can't grab it's handle unless it actually exists
- but as soon as the Input> command is executed and the window pops up, the script stops while it waits for user input i.e. you can't execute the above code renaming the window...
- unless you do it from a different script running simultaneously that is
- you could write a second script that runs in a loop who's only function is to continually check for the existance of a window with title="Macro Scheduler Input" and as soon as it sees one, it changes its title
Instead you could create your own custom dialog which means:
- open the dialog designer
- adding a label to tell the the user what to enter
- adding an Edit field to allow them to type in a value
- adding at least an OK button
- saving the dialog and inserting it into your script
- and now you have to add code to deal with the dialog
- a line to Show> the Dialog
- code to process the dialog return code
- if this is a v12 dialog, you need to add dialog event handlers
...and that's why, long ago, I felt that the Input> command could have been enhanced to add one more optional parameter so we could specify a title if desired, like this:
That would be about the most concise, low maintennance way to give us this ability... but if this never happens, I won't complain because yes I can use a custom dialog so its not like there isn't a way to set the title and get input.a long ago thought I probably never wrote:Input>variable,prompt[,default_value,title]
The optional "title" parameter can be a variable.
Now here's something that Input> may not be able to do:
And what does it return if the user simply enters nothing and clicks OK?Help File wrote:If the Input dialog is cancelled (cancel is pressed) Input returns an empty string.
It returns exactly the same thing... the variable will contain an empty string.
The problem is, I want to do two different things:
- If the User clicked the Cancel button, I want to end the macro immediately
- But if the user just entered nothing and clicked OK, I want to tell them that a value is required here and present the Input> dialog again...
Question for Marcus: If there is no way, could this please be added to the wish list?
Thanks for listening and take care
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Another option:
VBSTART
VBEND
VBEval>InputBox("Please enter your name:","My Input Box",""),result
Documented here:
http://msdn.microsoft.com/en-us/library ... s.85).aspx
But note also that this returns an empty string if Cancel is pressed.
Normally it would be assumed that if OK was pressed and nothing entered that this can be interpreted the same as a cancel. Also if something MUST be entered then that would imply that you cannot cancel and therefore even if cancel was pressed you'd still want to say "sorry, you must enter something" and therefore for all logical purposes OK+"" is the same as cancel. A workaround if you do want them to be different is to set the default to " " and then check for that for if ok was pressed with nothing being entered by the user the default of " " would be returned whereas cancel would return "".[/url]
VBSTART
VBEND
VBEval>InputBox("Please enter your name:","My Input Box",""),result
Documented here:
http://msdn.microsoft.com/en-us/library ... s.85).aspx
But note also that this returns an empty string if Cancel is pressed.
Normally it would be assumed that if OK was pressed and nothing entered that this can be interpreted the same as a cancel. Also if something MUST be entered then that would imply that you cannot cancel and therefore even if cancel was pressed you'd still want to say "sorry, you must enter something" and therefore for all logical purposes OK+"" is the same as cancel. A workaround if you do want them to be different is to set the default to " " and then check for that for if ok was pressed with nothing being entered by the user the default of " " would be returned whereas cancel would return "".[/url]
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi Marcus,
Thanks for the quick reply.
I was going to use the workaround method you mentioned... but after some Googling, I found this: http://www.scriptinganswers.com/forum2/ ... p?TID=3602 and learned that with a VBScript InputBox, there actually is a way to differentiate between whether the user clicked Cancel or clicked OK. It has to do with the varType of the data returned by the InputBox... it will be one type if Cancel was clicked and another if OK was clicked.
So I wrote a VBScript Function that can be called with VBEval> that will let me use a VBScript InputBox.
Thanks for the quick reply.
I was going to use the workaround method you mentioned... but after some Googling, I found this: http://www.scriptinganswers.com/forum2/ ... p?TID=3602 and learned that with a VBScript InputBox, there actually is a way to differentiate between whether the user clicked Cancel or clicked OK. It has to do with the varType of the data returned by the InputBox... it will be one type if Cancel was clicked and another if OK was clicked.
So I wrote a VBScript Function that can be called with VBEval> that will let me use a VBScript InputBox.
- If the user clicks Cancel, the script ends immediately
- If the user blanks out the input text and clicks OK, it knows that OK has been clicked and can see the data and since it is length 0, it reminds the user they must enter something and asks again.
Code: Select all
VBSTART
Function MyInputBox (MyPrompt,MyTitle,MyDefault)
return = InputBox(MyPrompt,MyTitle,MyDefault)
If vbEmpty = VarType(return) Then cancel_clicked = 1
If vbString = VarType(return) Then cancel_clicked = 0
MyInputBox = cancel_clicked & return
End Function
VBEND
//inspired by:
//http://www.scriptinganswers.com/forum2/forum_posts.asp?TID=3602
Let>prompt=Enter User ID:
Let>title=System Logon
Let>default=jpuziano
//If any of the above MS vars could contain a double quote " then uncomment and use
//the next line to vbEscape them first, changing var name/s as appropriate
//StringReplace>my_text_variable,","",my_text_variable
Label>get_input_from_user
VBEval>MyInputBox("%prompt%","%title%","%default%"),result
MidStr>result,1,1,user_clicked_cancel_on_input_box
If>user_clicked_cancel_on_input_box=1,end
MidStr>result,2,1000,input_data
Length>input_data,input_data_length
If>input_data_length>0,user_provided_input
//If we make it to here, user did not cancel but also did not provide any input text
MDL>You must provide a User ID to Logon
Goto>get_input_from_user
Label>user_provided_input
MDL>Input Data: %input_data%%CRLF%%CRLF%Input Data Length: %input_data_length%
//more code here...
Label>end
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -