Jump to content
fruityth1ng

Search nvALT for text, and bring window to front

Recommended Posts

Much better! Thanks for the update that improves on the original! I made an adjustment to require an argument, but that’s just to better fit my workflow. Simple solution to a problem that has bugged me. :)

Share this post


Link to post

Me too! And it's surprising how often this trips me up.

 

Has anybody figured out a solution (I've tried a bunch of things--basically at random--but haven't figured it out yet!

Share this post


Link to post

I was able to successfully work around it by adding a third line to the AppleScript part of the workflow, so that it reads:

on alfred_script(q)
tell application "nvALT"
  reopen
  activate
  tell application "System Events" to keystroke "l" using command down
end tell
end alfred_script
Edited by tsigo

Share this post


Link to post

tsigo's fix is only partially working for me on Mavericks--is it still working for others? If nvAlt is not currently open, this workflow will open nvAlt, but not insert the search string. If nvAlt is currently open, the workflow works as expected: puts the search string in the omnibar of nvalt.  Curious to hear if this is my problem, or if others are experiencing it as well.

Share this post


Link to post

tsigo's fix is only partially working for me on Mavericks--is it still working for others? If nvAlt is not currently open, this workflow will open nvAlt, but not insert the search string. If nvAlt is currently open, the workflow works as expected: puts the search string in the omnibar of nvalt.  Curious to hear if this is my problem, or if others are experiencing it as well.

 

Same issue here.

Share this post


Link to post

Here is what I came up with - it brings nvAlt to front, focuses on input, and enters search query.

on alfred_script(q)
tell application "nvALT"
	reopen
	activate
	tell application "System Events" to keystroke "l" using command down
	tell application "System Events" to keystroke q
end tell
end alfred_script

Share this post


Link to post

It works perfect for me. Thanks.

 

 

Here is what I came up with - it brings nvAlt to front, focuses on input, and enters search query.

on alfred_script(q)
tell application "nvALT"
	reopen
	activate
	tell application "System Events" to keystroke "l" using command down
	tell application "System Events" to keystroke q
end tell
end alfred_script

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×