User entry of text in the middle of macro execution...
Moderators: JRL, Dorian (MJT support)
User entry of text in the middle of macro execution...
I'd like to know whether it's possible to create a macro with MS under the following conditions:
I have a screen capture program I'd like to automate saving of files.
1. After I select image to capture, the capture program window pops up with the capture.
2. I want to invoke a macro that automatically hits the "Save As" button, thereby bringing up the "Save as" dialog window which asks for file name, etc.
3. At this stage, my macro waits for me to type in whatever name, after which I hit the key as a signal my input is over.
4. Macro then resumes by closing out all screens.
I have been reading the manual and evaluating the program. It's pretty straightforward to create a macro to do steps 2 and 4 above, but I don't see anything that will allow the macro to "wait" for my input.
In doing tests, I have tried using "waitkeydown>enter" (pressing the enter key after I named my file) as a signal for it to resume, but it won't let me place any text input in the "Save as" box. The only thing it accepts is the "enter" key being pressed b4 resuming.
Has anyone successfully created a macro in which the user can successfully do some manual text entries in the middle of the macro, such as typing in a filename in a "Save as" box before the macro resumes?
Does MS (or any other macro program) have the capability to do this?
TIA
I have a screen capture program I'd like to automate saving of files.
1. After I select image to capture, the capture program window pops up with the capture.
2. I want to invoke a macro that automatically hits the "Save As" button, thereby bringing up the "Save as" dialog window which asks for file name, etc.
3. At this stage, my macro waits for me to type in whatever name, after which I hit the key as a signal my input is over.
4. Macro then resumes by closing out all screens.
I have been reading the manual and evaluating the program. It's pretty straightforward to create a macro to do steps 2 and 4 above, but I don't see anything that will allow the macro to "wait" for my input.
In doing tests, I have tried using "waitkeydown>enter" (pressing the enter key after I named my file) as a signal for it to resume, but it won't let me place any text input in the "Save as" box. The only thing it accepts is the "enter" key being pressed b4 resuming.
Has anyone successfully created a macro in which the user can successfully do some manual text entries in the middle of the macro, such as typing in a filename in a "Save as" box before the macro resumes?
Does MS (or any other macro program) have the capability to do this?
TIA
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Just add a line using the INPUT> command.
An alternative to consider is to come up with an algorithm to automatically create the names so you don't need to pause at all. Let Macro Scheduler enter the name automatically based on the formula you create.
Then use Send>%FileName% in the Save As name box.Input>FileName,Please enter the filename ...
An alternative to consider is to come up with an algorithm to automatically create the names so you don't need to pause at all. Let Macro Scheduler enter the name automatically based on the formula you create.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Correct me if I'm wrong! The INPUT> command will stop any following script execution (therefore WaitKeyDown> isn't necessary) until the user will have done his/her input (so the following SEND> won't work for the input).
Why not using a tool like "Capture"? It creates a file name by default, right after executed via a keyboard shortcut - search the forum for the download link ...
Why not using a tool like "Capture"? It creates a file name by default, right after executed via a keyboard shortcut - search the forum for the download link ...
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Hi Lumumba
I don't think you are wrong, but perhaps not totally correct? Input will stop processing, but only until the Input Prompt Dialog is closed, then the macro script will continue. And Input Dialaog also has a Browse button on the Input Dialog which makes it real nice for Opening/Saving filenames. (Browse was added with Version 5.0 - 10/21/98. )
Here is an example using TextPad editor to create a file, and prompt to enter the filename to be saved:
(Macro created using version 7.2.043)
I don't think you are wrong, but perhaps not totally correct? Input will stop processing, but only until the Input Prompt Dialog is closed, then the macro script will continue. And Input Dialaog also has a Browse button on the Input Dialog which makes it real nice for Opening/Saving filenames. (Browse was added with Version 5.0 - 10/21/98. )
Here is an example using TextPad editor to create a file, and prompt to enter the filename to be saved:
In actual practice, extra lines should be added to check to see if Input box was cancelled without making an entry, but this is the basic script needed.//---------Create file to be saved
Run Program>C:\Program Files\Textpad 4\textpad.exe
WaitWindowOpen>Textpad*
Send>This the the first line.
Press ENTER
Send>This is line two.
//------------------Step 2. Prepare to Save File
Press ALT
Send>FA
Release ALT
WaitWindowOpen>Save As
//-----------------Step 3. Get input from user.
Input>FileName,Enter file name to be saved
Send>%FileName%
Press ENTER
WaitWindowClosed>Save As
//-----------------Step 4. Close program
Press ALT
Send>Fx
WaitWindowClosed>TextPad*
Label>End
(Macro created using version 7.2.043)
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Thanks guys for your input. I appreciate the link for the Capture program, Lumumba, but I need something more powerful. My capture program does what I need except that I have to close one too many screens in the process. Just lazy
.
Initially, I created something with another macro program that would automate the closing of all the screens after I entered the filename in the "Save As" box and invoked the macro with hotkey.
But then I began to think about the possibility of automating everything with a hotkey once I made the screen capture selection. It would be great, getting to your suggestion, Bob, to have the program automatically create names, BUT, I save a wide variety of screen captures (bmp,jpeg) of various color depths.
To have the program evaluate all those conditions (whether it's a jpeg, or a 6, 24 bit bitmap) I don't think is even possible, or at least it's way out of my coding ability.
Anyway, the closest thing I could think of was have the macro pause and let me enter in the filename and particulars on the 'Save As' screen, and take my hitting the 'enter' key as a cue to continue. This was beyond the capability of the program I was using at the time, so that's why I started to look around and came upon scheduler.
Anywayy... question Bob, your rec of using input would make a dialog box created by scheduler, on top of the dialog box I already have from my program.
I don't want to unnecessarily complicate with another dialog box. Is there any way for scheduler to take the input from the existing 'Save As' dialog box that's already made by my capture program? (ie. waiting for when I hit the 'enter' key b/4 proceeding?

Initially, I created something with another macro program that would automate the closing of all the screens after I entered the filename in the "Save As" box and invoked the macro with hotkey.
But then I began to think about the possibility of automating everything with a hotkey once I made the screen capture selection. It would be great, getting to your suggestion, Bob, to have the program automatically create names, BUT, I save a wide variety of screen captures (bmp,jpeg) of various color depths.
To have the program evaluate all those conditions (whether it's a jpeg, or a 6, 24 bit bitmap) I don't think is even possible, or at least it's way out of my coding ability.
Anyway, the closest thing I could think of was have the macro pause and let me enter in the filename and particulars on the 'Save As' screen, and take my hitting the 'enter' key as a cue to continue. This was beyond the capability of the program I was using at the time, so that's why I started to look around and came upon scheduler.
Anywayy... question Bob, your rec of using input would make a dialog box created by scheduler, on top of the dialog box I already have from my program.
I don't want to unnecessarily complicate with another dialog box. Is there any way for scheduler to take the input from the existing 'Save As' dialog box that's already made by my capture program? (ie. waiting for when I hit the 'enter' key b/4 proceeding?
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
No problem. But I think the process I originally defined will work for you. Just use your program vs. TextPad, but SaveAs should probably work the same way.Is there any way for scheduler to take the input from the existing 'Save As' dialog box that's already made by my capture program? (ie. waiting for when I hit the 'enter' key b/4 proceeding?
Anyway......If you need to capture the value of the Save As field here is one approach:
1. Be sure there is nothing in the clipboard. Move to SaveAs field.
2. Put in a WAIT>30 or more to allow data entry.
3. Next command would be CTL-C on the SaveAs field to copy to clipboard.
4. Do a test to make sure there is a value in the clipboard (Length of variable is >0?. If not>0 then loop x times or every y seconds until done).
5. Press Enter to do the Save As.
6. Paste from clipboard to where ever you want.
If you need to just wait, and don't need to capture value of saved name, then perhaps just use an ASK command, that will halt the macro until you press YES/NO. Losing focus may be an issue though because the Ask box may disappear while you are entering the value you want.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
The following code is based on the Save As-Dialog from MSPAINT (which should be part of your OS):
Day>D
Month>M
Year>Y
Hour>h
Min>m
Sec>s
Let>IName=%Y%%M%%D%-%h%-%m%-%s%
Let>ImageDestinationPath=C:\myimages
WaitWindowOpen>Save As
Press ALT
Send>n
Release ALT
Send>%ImageDestinationPath%\%IName%
//So you'll get a (unique) default filename and you're are able to select a specific file format
WaitWindowClosed>Save As
Currently it's up to you to decide which colour depth to select.
Isn't it standard with modern digital cameras to attach additional info: eg. size/date/format to the image ?? As I remember there are tools around to extract such a kind of information from the image (won't image magick provide this? --> the page I've recommended should contain the link)
Day>D
Month>M
Year>Y
Hour>h
Min>m
Sec>s
Let>IName=%Y%%M%%D%-%h%-%m%-%s%
Let>ImageDestinationPath=C:\myimages
WaitWindowOpen>Save As
Press ALT
Send>n
Release ALT
Send>%ImageDestinationPath%\%IName%
//So you'll get a (unique) default filename and you're are able to select a specific file format
WaitWindowClosed>Save As
Currently it's up to you to decide which colour depth to select.
Isn't it standard with modern digital cameras to attach additional info: eg. size/date/format to the image ?? As I remember there are tools around to extract such a kind of information from the image (won't image magick provide this? --> the page I've recommended should contain the link)