trblwillfindme Posted January 31, 2022 Report Share Posted January 31, 2022 I need macro to get number from clipboard and add to this number 25 and this number paste in selected text field. Can anyone help with this please? Quote Link to comment Share on other sites More sharing options...
trblwillfindme Posted January 31, 2022 Author Report Share Posted January 31, 2022 and same macro but with number 20 pls Quote Link to comment Share on other sites More sharing options...
Cory Posted January 31, 2022 Report Share Posted January 31, 2022 See attached. There's no scope or activation defined. Add.mex 1 Quote Link to comment Share on other sites More sharing options...
acantor Posted January 31, 2022 Report Share Posted January 31, 2022 This should work as long as there is no text in the field. It handles non-integers. The script selects the entire field and copies it to the clipboard before adding the two values. Text Type (Simulate Keystrokes): <HOME><SHIFT><END> // Select the entire field Clipboard Copy Variable Set Decimal %ClipDecimal% from the clipboard contents // Assign variable %ClipDecimal% to the clipboard Variable Modify Decimal: %SumDecimal% = %ClipDecimal% + 20 Text Type (Simulate Keystrokes): %SumDecimal% Quote Link to comment Share on other sites More sharing options...
trblwillfindme Posted January 31, 2022 Author Report Share Posted January 31, 2022 1 hour ago, acantor said: This should work as long as there is no text in the field. It handles non-integers. The script selects the entire field and copies it to the clipboard before adding the two values. Text Type (Simulate Keystrokes): <HOME><SHIFT><END> // Select the entire field Clipboard Copy Variable Set Decimal %ClipDecimal% from the clipboard contents // Assign variable %ClipDecimal% to the clipboard Variable Modify Decimal: %SumDecimal% = %ClipDecimal% + 20 Text Type (Simulate Keystrokes): %SumDecimal% sorry, I didn't understand how to put this into the program Quote Link to comment Share on other sites More sharing options...
trblwillfindme Posted January 31, 2022 Author Report Share Posted January 31, 2022 2 hours ago, Cory said: See attached. There's no scope or activation defined. Add.mex 1.29 kB · 1 download Thanks a lot, it's working. Didn't mention I need this macros to work with dates. Can you adopt it? For example, I have 11.11.2011 and I need to get 11.11.2036. Month and day stays the same, year changes. Quote Link to comment Share on other sites More sharing options...
Cory Posted January 31, 2022 Report Share Posted January 31, 2022 It's the same process. Just cast the sting to a date/time variable type instead of integer. Then add 20 to the year part of the Date/Time. 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.