winterflags Posted September 16, 2016 Share Posted September 16, 2016 Is there some way to exclude a certain workflow from syncing between my two computers running Alfred? I'm using Dropbox to sync Alfred. The reason is that when I access computer A from computer B via screen sharing, pressing ALT + SPACE will Show Alfred on computer B, and not computer A. So I've set up an alternative Hotkey to Show Alfred. But now I need to be able to only use it on computer A, and not computer B. Thanks! Link to comment
dfay Posted September 17, 2016 Share Posted September 17, 2016 You can use Applescript to write a workflow that behaves differently depending on which computer it's running on. Basically you'd set your hotkey to call an Applescript like this: set theComp to computer name of (system info) if theComp = "computer A" then // do something else if theComp = "computer B" then return end if winterflags 1 Link to comment
winterflags Posted September 17, 2016 Author Share Posted September 17, 2016 (edited) 4 hours ago, dfay said: You can use Applescript to write a workflow that behaves differently depending on which computer it's running on. Basically you'd set your hotkey to call an Applescript like this: set theComp to computer name of (system info) if theComp = "computer A" then // do something else if theComp = "computer B" then return end if Thanks for that dfay, that should work nicely. I tried assigning an Alfred Hotkey to SHIFT + ALT + SPACE, and then tried to bind it to Run NSAppleScript and alternatively Run Script, can't get it to work however. Should this script be functional? set theComp to computer name of (system info) if theComp = "Computer-A" then tell application "System Events" to keystroke "space" using {option down} else if theComp = "Computer-B" then return end if I also tried to prepend/append: on alfred_script(q) end alfred_script … which didn't do anything. FYI, I got computer name via scutil --get ComputerName Edited September 17, 2016 by winterflags Link to comment
deanishe Posted September 17, 2016 Share Posted September 17, 2016 This should do the trick: set myName to computer name of (system info) if myName = "MACHINE NAME" then tell application "Alfred 3" to search end if winterflags 1 Link to comment
winterflags Posted September 17, 2016 Author Share Posted September 17, 2016 53 minutes ago, deanishe said: This should do the trick: set myName to computer name of (system info) if myName = "MACHINE NAME" then tell application "Alfred 3" to search end if Thanks a lot! Got it to work by assigning hotkey and binding it to a Run NSAppleScript with these contents: on alfred_script(q) set myName to computer name of (system info) if myName = "Computer-A" then tell application "Alfred 3" to search end if end alfred_script 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