bcometa Posted March 23, 2013 Posted March 23, 2013 Hi Forum! I have a simple script to add currently selected text to my Sticky Note. It works great using the hotkey. Then I wanted the ability to add a "Fallback Search" so whatever I have typed in Alfred will be moved to Sticky Note. The latter isn't working and I'm not sure why. Here's the working HotKey script: tell application "Stickies" to activate tell application "System Events" tell process "Stickies" tell window 1 keystroke "{query}" keystroke return keystroke "-" keystroke return end tell end tell end tell Can someone provide me with a solution for this to work with a Fallback Search?
jdfwarrior Posted March 24, 2013 Posted March 24, 2013 Hi Forum! I have a simple script to add currently selected text to my Sticky Note. It works great using the hotkey. Then I wanted the ability to add a "Fallback Search" so whatever I have typed in Alfred will be moved to Sticky Note. The latter isn't working and I'm not sure why. Here's the working HotKey script: tell application "Stickies" to activate tell application "System Events" tell process "Stickies" tell window 1 keystroke "{query}" keystroke return keystroke "-" keystroke return end tell end tell end tell Can someone provide me with a solution for this to work with a Fallback Search? You are currently not able to set a workflow or something similar as a fallback search. I would suggest you simply create a workflow and set a keyword for it and just use the keyword to action it instead.
bcometa Posted March 24, 2013 Author Posted March 24, 2013 Ok, I tried that but now it only works for adding single words. I'm guessing this is an applescript problem, but I can't find a work around. I also tried: set theNote to "{query}" as text tell application "Stickies" to activate tell application "System Events" set the clipboard to theNote tell process "Stickies" tell window 1 keystroke "v" using command down keystroke return keystroke "-" keystroke return end tell end tell end tell Does anyone know off-hand the solution?
jdfwarrior Posted March 24, 2013 Posted March 24, 2013 Ok, I tried that but now it only works for adding single words. I'm guessing this is an applescript problem, but I can't find a work around. I also tried: set theNote to "{query}" as text tell application "Stickies" to activate tell application "System Events" set the clipboard to theNote tell process "Stickies" tell window 1 keystroke "v" using command down keystroke return keystroke "-" keystroke return end tell end tell end tell Does anyone know off-hand the solution? Could you try this and verify that it works? set theNote to "{query}" as text tell application "Stickies" to (activate) tell application "System Events" set the clipboard to theNote tell process "Stickies" to tell window 1 to keystroke "v" using command down tell process "Stickies" to tell window 1 to key code 36 tell process "Stickies" to tell window 1 to keystroke "-" tell process "Stickies" to tell window 1 to key code 36 end tell
bcometa Posted March 24, 2013 Author Posted March 24, 2013 Thanks for your help David. Unfortunately, it also only does one word. So if I type "stick test" in alfred, that works. But "stick test test" doesn't work.
bcometa Posted March 24, 2013 Author Posted March 24, 2013 D'oh! It was an easy fix. The problem came from me not understanding what "Escaping" meant with all options checked. Since "Escaping" was checked for "Space" the query shortened itself. All fixed now. Thanks for your help!
jdfwarrior Posted March 25, 2013 Posted March 25, 2013 D'oh! It was an easy fix. The problem came from me not understanding what "Escaping" meant with all options checked. Since "Escaping" was checked for "Space" the query shortened itself. All fixed now. Thanks for your help! Ha cool. I read the first reply and was thinking, "I know I had it working yesterday..". Glad you were able to figure it out
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