Detecting computer
Moderators: JRL, Dorian (MJT support)
Detecting computer
I´m running the same macro on two computers. The mousemove
should be different on the two computers. Unfortunately it doesn´t
work like below. The macro takes the first two values undependent
of which computer I´m using.
Could anybody please advice me what is wrong with the macro?
//messagemodal>COMPUTER_NAME
IF COMPUTER_NAME=HP30222709268
Let Mus1=492
Let Mus2=369
ELSE
Let Mus1=492
Let Mus2=343
ENDIF
MouseMove>Mus1,Mus2
Bests
Cnrad
should be different on the two computers. Unfortunately it doesn´t
work like below. The macro takes the first two values undependent
of which computer I´m using.
Could anybody please advice me what is wrong with the macro?
//messagemodal>COMPUTER_NAME
IF COMPUTER_NAME=HP30222709268
Let Mus1=492
Let Mus2=369
ELSE
Let Mus1=492
Let Mus2=343
ENDIF
MouseMove>Mus1,Mus2
Bests
Cnrad
Most Macro Scheduler functions require a greater than symbol ">" as a delimiter between the function and the rest of the parameters. You have not included that symbol in your If> statement. For some reason the Let> function works without the greater than symbol so there's a bit of confusion. Anyway if you look up a function's syntax in help, it will tell you when you need or don't need the greater than symbol.
Its easy to see help for a particular function once you have the name typed into the editor. while the cursor is on the function line, press F1.
try tjhis:
Its easy to see help for a particular function once you have the name typed into the editor. while the cursor is on the function line, press F1.
try tjhis:
Code: Select all
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
-
- Junior Coder
- Posts: 35
- Joined: Thu Jan 12, 2006 9:20 pm
- Contact:
The lack of the greater than is ABSOLUTELY a part of the issue. If you leave out the greater than, the "IF" test fails and will always ONLY process the script portion before the "ELSE".I suspect the lack of greater than (>) is not part of the issue.
Try the following:
Code: Select all
Let>a=1
If a=2
Let>b=2
Else
Let>b=3
EndIf
MDL>b = %b%
There still could be an issue with matching text to the COMPUTER_NAME variable. But until the correct syntax is used you'll never know.
-
- Junior Coder
- Posts: 35
- Joined: Thu Jan 12, 2006 9:20 pm
- Contact:
Thanks JRL for you help!
It seems however to be something strange about this.
Your correct code doesn´t work either
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
But if I change to something more clumsy it works
/messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Computer=Home
ELSE
Let>Computer=Work
ENDIF
If>Computer=Home
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
I´ve seen this behaviour before, a bug in the program?
It seems however to be something strange about this.
Your correct code doesn´t work either
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
But if I change to something more clumsy it works
/messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Computer=Home
ELSE
Let>Computer=Work
ENDIF
If>Computer=Home
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
I´ve seen this behaviour before, a bug in the program?
If I substitute my computer name, this works just fine for me.
IF>COMPUTER_NAME=HOME-II
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
You haven't said what version of Macro Scheduler you're using. And how is the code
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
failing?
IF>COMPUTER_NAME=HOME-II
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
You haven't said what version of Macro Scheduler you're using. And how is the code
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
failing?
Thank you JRL for your continued help!
I´m using version 11.1.05 standard.
The code fails while Macro Scheduler doesn´t make a choice between
the first and second option, it just steps through the code and ends
up with Mus1=492 and Mus2=343 independent if it is my work computer or
my home computer. With my "clumsy" version it works
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
I´m using version 11.1.05 standard.
The code fails while Macro Scheduler doesn´t make a choice between
the first and second option, it just steps through the code and ends
up with Mus1=492 and Mus2=343 independent if it is my work computer or
my home computer. With my "clumsy" version it works
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
This code works fine for me, XP PRO SP2, Macro Scheduler 11.1.05
Mus2 changes based on matching COMPUTER_NAME
Code: Select all
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Run the following and log the result. post the log.
Code: Select all
//messagemodal>COMPUTER_NAME
IF>%COMPUTER_NAME%=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>%Mus1%,%Mus2%
Hi Conrad51,
When I substitute my computer name into your code as you posted it above... it runs as I would expect... the first two values are set. I am running 11.1.05 on XP SP3 as well.
My guess would be that maybe you've typed a zero 0 where a letter O should have been in your computer name value. If you just copy and paste the string displayed when you run the following line...
...you should be OK.
One other thing, I'm not sure if its possible but if it is... you may have a trailing space character in your computer name. If that's there, you'd need to include it at the end of the value you have there in the IF> statement... to get it to match properly.
Here's a quick way to test to see if there are trailing spaces in your computer name:
If the number of characters displayed matches the count, you're fine, but if the count is larger, you may have a trailing space.
Please let us know your findings...
Sidenote: Marcus - there's a problem with the color syntax highlighting.
1) paste the following code between the lines below (not including the lines) into a new macro
-------------------------------------------
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
-------------------------------------------
2) Edit/Remove Trailing Spaces
3) Delete the first two // characters in the first line
The first line then looks like this for me:
messagemodal>COMPUTER_NAME
But it should look like this:
messagemodal>COMPUTER_NAME
If you copy and paste that first line lower down... color syntax highlighting comes out right.
Code: Select all
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
My guess would be that maybe you've typed a zero 0 where a letter O should have been in your computer name value. If you just copy and paste the string displayed when you run the following line...
Code: Select all
messagemodal>COMPUTER_NAME
One other thing, I'm not sure if its possible but if it is... you may have a trailing space character in your computer name. If that's there, you'd need to include it at the end of the value you have there in the IF> statement... to get it to match properly.
Here's a quick way to test to see if there are trailing spaces in your computer name:
Code: Select all
Length>COMPUTER_NAME,count
MDL>%COMPUTER_NAME%%CRLF%%count%
Please let us know your findings...
Sidenote: Marcus - there's a problem with the color syntax highlighting.
1) paste the following code between the lines below (not including the lines) into a new macro
-------------------------------------------
//messagemodal>COMPUTER_NAME
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
-------------------------------------------
2) Edit/Remove Trailing Spaces
3) Delete the first two // characters in the first line
The first line then looks like this for me:
messagemodal>COMPUTER_NAME
But it should look like this:
messagemodal>COMPUTER_NAME
If you copy and paste that first line lower down... color syntax highlighting comes out right.
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:
I've tried to explain this before. In the interests of performance and usability there is sometimes a delay before syntax highlighting happens and sometimes further edits are required. If you insert a new line before the message modal it will highlight correctly.Sidenote: Marcus - there's a problem with the color syntax highlighting.
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?
Thanks for the reply. So its a known issue... not a bug... a trade-off being made for the reasons you stated.mtettmar wrote:I've tried to explain this before. In the interests of performance and usability there is sometimes a delay before syntax highlighting happens and sometimes further edits are required. If you insert a new line before the message modal it will highlight correctly.Sidenote: Marcus - there's a problem with the color syntax highlighting.
Sorry, I suppose if I had searched the forums... I might have found where you tried to explain that before.
On the other hand, if there were a place we could go to review a list of "known issues" before posting a possible bug... that would sure help. We sort of had that before with BugTracker... but now, searching the forums is the only recourse... and hoping we've picked the correct words to search on.
Take care
Last edited by jpuziano on Sat Mar 07, 2009 10:43 pm, edited 1 time in total.
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 -

Hi Conrad51,Conrad51 wrote:If I add % on both sides of COMPUTER_NAME like JRL proposed
it works! However it is not needed to add % to Mus1 and Mus2.
I want to thank all of you who tried to help me
IF>%COMPUTER_NAME%=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>%Mus1%,%Mus2%
Are you saying that on your machine, this code:
SCRIPT A
Code: Select all
IF>%COMPUTER_NAME%=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
MDL>Mus2
SCRIPT B
Code: Select all
IF>COMPUTER_NAME=HP30222709268
Let>Mus1=492
Let>Mus2=369
ELSE
Let>Mus1=492
Let>Mus2=343
ENDIF
MouseMove>Mus1,Mus2
MDL>Mus2
The only difference between the two scripts above are the percent % symbols around COMPUTER_NAME.
I threw in the following line...
MDL>Mus2
...to make it easy to see what happened.
If the If statement on the first line of code matches, then Mus2 is going to be 369.
If the If statement on the first line of code does not match, then Mus2 is going to be 343.
From what I can see, script A and B should behave exactly the same if run on the same machine... they did for me when I substituted in the proper value for COMPUTER_NAME on this machine.
However, if script A and B don't behave exactly the same for you Conrad51... then there's still a mystery here that should be solved.
Please let us know 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 -
