dhertz Posted March 9, 2013 Share Posted March 9, 2013 (edited) Updated the extension originally found here by Runar and fireshadow52. download Update 03 April: download Edited April 3, 2013 by dhertz Link to comment
MorseCode Posted March 13, 2013 Share Posted March 13, 2013 Sparrow is still the fastest, most functional mail client on OS X, and that's with no new development for 6+ months. Enhorn 1 Link to comment
69wpm Posted March 14, 2013 Share Posted March 14, 2013 This doesn't seem to work when the Sparrow window is not open, but closed. Link to comment
jkblackman77 Posted March 20, 2013 Share Posted March 20, 2013 This doesn't seem to work when the Sparrow window is not open, but closed. Hello, I had this problem too so i tried adding a delay of 0.5 seconds into the script - it now opens sparrow first before searching. the script now reads... on alfred_script(q) delay 0.5 tell application "Sparrow" to activate --- activates sparrow tell application "System Events" tell process "Sparrow" --- implying Sparrow is already activated key code 3 using {command down, option down} --- send cmd+alt+F to Sparrow invoking search keystroke q --- enter the query end tell end tell end alfred_script 69wpm 1 Link to comment
69wpm Posted March 21, 2013 Share Posted March 21, 2013 (edited) Hello, I had this problem too so i tried adding a delay of 0.5 seconds into the script - it now opens sparrow first before searching. the script now reads... on alfred_script(q) delay 0.5 tell application "Sparrow" to activate --- activates sparrow tell application "System Events" tell process "Sparrow" --- implying Sparrow is already activated key code 3 using {command down, option down} --- send cmd+alt+F to Sparrow invoking search keystroke q --- enter the query end tell end tell end alfred_script Cool, that works. Would be cool to extend the script to launch Sparrow first (if it's not already launched) and than execute the script. I am not big into programming, but it should be something like this: on alfred_script(q) tell application "System Events" set isSparrowRunning to (count of (every process whose name is "Sparrow")) > 0 end tell if isSparrowRunning then tell application "Sparrow" to activate --- activates sparrow tell application "System Events" tell process "Sparrow" --- implying Sparrow is already activated key code 3 using {command down, option down} --- send cmd+alt+F to Sparrow invoking search keystroke q --- enter the query end tell end tell else tell application "Sparrow " to launch delay 0.5 tell application "Sparrow" to activate --- activates sparrow tell application "System Events" tell process "Sparrow" --- implying Sparrow is already activated key code 3 using {command down, option down} --- send cmd+alt+F to Sparrow invoking search keystroke q --- enter the query end tell end tell end if end alfred_script It doesn't work as it should, launching Sparrow works, but when it's launched, the window focus and search does not work. I guess we have to set some delays. Maybe somebody can help out. Edited March 21, 2013 by 69wpm Link to comment
blueneogeo Posted April 3, 2013 Share Posted April 3, 2013 If you close the sparrow window instead of hiding it, the sparrow button in the dock needs to be clicked in order for sparrow to generate the window again. So I got it to work completely by scripting in the click on the 'Sparrow' item in the dock: on alfred_script(q) delay 0.5 tell application "Sparrow" to activate --- activates sparrow tell application "System Events" tell process "Dock" click UI element "Sparrow" of list 1 --- click the dock item to generate a window end tell tell process "Sparrow" --- implying Sparrow is already activated key code 3 using {command down, option down} --- send cmd+alt+F to Sparrow invoking search keystroke q --- enter the query end tell end tell end alfred_script Link to comment
dhertz Posted April 3, 2013 Author Share Posted April 3, 2013 So Sparrow doesn't need to be in your dock: on alfred_script(q) tell application "System Events" set isSparrowRunning to exists (processes where name is "Sparrow") end tell if not isSparrowRunning then tell application "Sparrow" to launch delay 0.5 end if tell application "Sparrow" to activate --- activates sparrow tell application "System Events" tell process "Sparrow" --- implying Sparrow is already activated key code 3 using {command down, option down} --- send cmd+alt+F to Sparrow invoking search keystroke q --- enter the query end tell end tell end alfred_script also an easy link: download Link to comment
rspike12 Posted October 31, 2013 Share Posted October 31, 2013 this doesn't work when Sparrow window is hide in the dock any help? 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