Hints, tips and tricks for newbies
Moderators: Dorian (MJT support), JRL
-
ahmadka
- Newbie
- Posts: 2
- Joined: Sun Oct 03, 2010 7:25 pm
Post
by ahmadka » Sun Oct 03, 2010 7:31 pm
Hey all ... I'm just trying out Macro Scheduler's scripting capabilities and have just spent the last 2 hours trying to debug this stupid thing ..
I'm typing in this in a script:
And so now the program should wait for 5 seconds before moving on .. but it doesn't ! This exact code above is also mentioned in Macro Scheduler's documentation for the Wait command ..
Also, suppose I use this code:
Again, a is not correctly being resolved and the program just sends 'a' out and writes this ..
Can somebody help me resolve these issues ?
-
JRL
- Automation Wizard
- Posts: 3526
- Joined: Mon Jan 10, 2005 6:22 pm
- Location: Iowa
Post
by JRL » Sun Oct 03, 2010 8:36 pm
In the first script you need to use the Let> function.
In the second script, you need to have someplace to "Send" the text. Try this. The following script will open Notepad and Send> "2".
Code: Select all
Let>a=5-3
Run>notepad.exe
WaitWindowOpen>notepad*
SetFocus>Notepad*
Send>a
Last edited by
JRL on Mon Oct 04, 2010 1:03 pm, edited 1 time in total.
-
ahmadka
- Newbie
- Posts: 2
- Joined: Sun Oct 03, 2010 7:25 pm
Post
by ahmadka » Sun Oct 03, 2010 8:53 pm
In the first script I was using the 'Let' keyword .. I just forgot to mention it ..
In the second script, I had notepad running in the background .. what I did was script a trigger shortcut for my macro, then switched to notepad, and then ran the macro .. its essentially the same as what you suggested ..
-
JRL
- Automation Wizard
- Posts: 3526
- Joined: Mon Jan 10, 2005 6:22 pm
- Location: Iowa
Post
by JRL » Mon Oct 04, 2010 3:06 am
In the first script I was using the 'Let' keyword .. I just forgot to mention it
So it should work as posted. It works for me. Are there other lines of code in the script that you are not showing us? For example havng the line Let>VAREXPLICIT=1 in your script would explain both of your posted scripts not working. If VAREXPLICIT=1 you must place percents around your variables for them to resolve properly
what I did was script a trigger shortcut for my macro, then switched to notepad, and then ran the macro .. its essentially the same as what you suggested
That's true assuming you did exactly that. I tested that scenario using your posted code and received a "2" in my notepad window.
Is there anything else in your second test script other than the two lines?
Let>a=5-3
Send>a