silpart Posted May 19, 2016 Share Posted May 19, 2016 I want Alfred to record a series of keystrokes and mouse movements and replay them when a key is pressed. Basically I am sending messages in LinkedIn. Ideally every time I run the macro I'd like to incement the number value in the clipboard by 1. Can this be done and if so where can I learn how. Link to comment
FroZen_X Posted May 19, 2016 Share Posted May 19, 2016 What you can do is, that you create a script with Automator and let Alfred run this through a keyword or so. You can read out your clipboard via this applescript: set the_text to the clipboard return the_text Then use the this python script to increment every integer in your string: import re print re.sub('\d+',lambda x:`int(x.group())+1`,query) I've put an example workflow here together: https://www.dropbox.com/s/d7ld56vxb4nfjcf/Example%20String%20Int%20increase%20by%201.alfredworkflow?dl=0 Copy this string: "test 1 and 2 and 3" and run the workflow via "inctest" and it will give you this notification "test 2 and 3 and 4" For the rest i or other would have to know, or you now know enough Hope that helps ^^ Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now