xodusx Posted September 29, 2007 Report Share Posted September 29, 2007 hey, this is my first post here and wanted to ask a question. I have been using Macro express for around 3 months and its great! My question is, Is it possible to create a macro that highlights a number and adds a certain amount to it? Lets say i type in 333 in notepad, can i make a macro that would highlight it (double click it) and then add 100 to it for example. The only part i dont know about is the adding a set number to the already existing one. Thanks in advance Quote Link to comment Share on other sites More sharing options...
floyd Posted September 29, 2007 Report Share Posted September 29, 2007 Welcome. You'll want to have a look at the Variable Modify Integer command. Quote Link to comment Share on other sites More sharing options...
xodusx Posted September 29, 2007 Author Report Share Posted September 29, 2007 I looked into that, but i dont understand how it will actually get the number thats on notepad. What i have it doing so far is moving the mouse and highlighting the number then i inserted the %N2%=%N1%+100 then convert %N2% to text string %T1%, followed by Text Type %T1%. So what it does is it highlights the number and changes it to 100 since it assumes the value of N1 is 0. How do i make N1 be the number on notepad? Sorry im not that good at this :/ Thanks for the first reply Quote Link to comment Share on other sites More sharing options...
Cory Posted September 29, 2007 Report Share Posted September 29, 2007 Copy and past this into your scripting editor. <CLIPC><IVAR2:01:11:><NMVAR:01:01:1:0000001:2:0000100><TEXTTYPE:%N1%> It should look like: Clipboard Copy Variable Set Integer %N1% from Clipboard Variable Modify Integer: %N1% = %N1% + 100 Text Type: %N1% Once you highlight the text ask ME to do a ClipCopy. Then copy the clipboard contents to N1, add 100 to N1, and finally do a TextType using the 'use clipboard' option to put it back. Of course there are other ways. Quote Link to comment Share on other sites More sharing options...
xodusx Posted September 30, 2007 Author Report Share Posted September 30, 2007 thanks so much The Variable Modify integer tends to take like 1-2 seconds to actually input the number. Is this the fastest way to do it? Quote Link to comment Share on other sites More sharing options...
Namino Posted October 1, 2007 Report Share Posted October 1, 2007 It's not the Variable Modify integer commmand that takes a long time, it's the copy from the clipboard. You should use control commands if you want it faster. Something like: <LAUNCHDEL2:2:00C:\WINDOWS\NOTEPAD.EXE><WAITWIN2:000010:000000:Untitled - Notepad><TEXTTYPE:333><GETCONTROL:01:NOTEPAD.EXE:002:NotepadUntitled - NotepadEdit333><VARGETCONT:1:1><TMVAR2:05:01:01:000:000:><NMVAR:01:01:1:0000001:2:0000100><TEXTTYPE:<CTRLD>a<CTRLU>><TEXTTYPE:%N1%> Quote Link to comment Share on other sites More sharing options...
Cory Posted October 1, 2007 Report Share Posted October 1, 2007 The default delay setting for clipboard operations is only 250ms so I doubt that's the problem. Make sure your choosing to paste the text back in with the TT instead of typing. If your typing delay is slow that could cause it. And it wouldn’t hurt to check your preferences for that clipboard delay timing. Maybe you increased it at some point. Quote Link to comment Share on other sites More sharing options...
xodusx Posted October 1, 2007 Author Report Share Posted October 1, 2007 what i have so far is this: <TEXTTYPE:<END>><MMS2:654,494><LDCLK><CLIPC><IVAR2:01:11:><NMVAR:01:02:1:0000001:2:0004000><TEXTTYPE:%N2%><MMS2:580,538><LDN><LUP> It does what i want it to do, (this is on a site in Firefox) Goes to the bottom of the page, highlights the text in the text field, copies it, Adds the amount to it, Moves the mouse to the Submit button, and clicks it. Everything is fast except after copying the original number in the text box it takes 1-2 seconds to add the amount. Thats why i think its the modify integer value. The text is in TT so it cant be that, my typing delay is fast, but I'm not sure how to check clipboard delay timing. I can copy/paste manually fast so i don't think its that. Im not sure how to change your code Namino to work with firefox/the text box. looks like this thanks for all the help so far, I've learned a lot about this. Quote Link to comment Share on other sites More sharing options...
kevin Posted October 1, 2007 Report Share Posted October 1, 2007 Each time Macro Express accesses the clipboard there is a 250 millisecond delay. Your macro accesses the clipboard twice so you can expect a 1/2 second delay. I don't know why you are seeing a 1-2 second delay. To change the clipboard delay click Options, Preferences and Delays. You might be able to reduce the amount of delay. However, I have only been able to reduce this to 200 milliseconds and at that setting occasional errors occur. The technique I would use to determine what is happening in a macro like this is to add either Sound Beep or Sound Wave commands in the macro. Then you can 'hear' where in the macro the delay is occurring. Of course the sound commands themselves add delays. You might want to do something like this: Sound Wave File: 0.wav Text Type: <END> Mouse Move Screen 654, 494 Mouse Left Button Double Click Sound Wave File: 1.wav Clipboard Copy Sound Wave File: 2.wav Variable Set Integer %N1% from Clipboard Sound Wave File: 3.wav Variable Modify Integer: %N2% = %N1% + 4000 Text Type: %N2% Sound Wave File: 4.wav Mouse Move Screen 580, 538 Mouse Left Button Down Mouse Left Button Up Sound Wave File: 5.wav Quote Link to comment Share on other sites More sharing options...
xodusx Posted October 2, 2007 Author Report Share Posted October 2, 2007 it was definitely the delay options, it was at 250 and i changed it to 200 and it got faster. I kept changing it and eventually lowered it to 0 and im getting no errors and its instant Quote Link to comment Share on other sites More sharing options...
Cory Posted October 2, 2007 Report Share Posted October 2, 2007 That's funny Kevin. I too will add beeps as markers but I have also use the time command to make a series of timestamps down to the miliseconds. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 2, 2007 Report Share Posted October 2, 2007 That's funny Kevin. I too will add beeps as markers but I have also use the time command to make a series of timestamps down to the miliseconds. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.