Jump to content

Command line path to a pre-filled search?


Recommended Posts

I'm using Windows version 6.25.1.9091

I have a keyboard shortcut to launch a new note using this command that I use all the time:

"C:\Program Files (x86)\Evernote\Evernote\Evernote.exe" /NewNote

I've been trying to come up with a way of using a similar keyboard shortcut but in this case to launch a partially pre-filled search. Specifically I'm often searching intitle: and I'd like to press a button that launches evernote with the string intitle: already in the search field. Currently I do this with autohotkey but it would be smoother and less error prone if I could send it via command line.

Is that possible? I've tried things like:

"C:\Program Files (x86)\Evernote\Evernote\Evernote.exe" /q "intitle:1"

and

"C:\Program Files (x86)\Evernote\Evernote\Evernote.exe" shownotes /q "intitle:1"

with and without the "1" (figuring I could backspace over it) but none of those execute the search.

Thanks for any leads!

Link to comment
  • Level 5*

Hi.  Why not just use AHK (or similar) to generate the standard search and leave your cursor in the field at the correct point?  I use Phrase Express and Text Blaze (a browser add-in) both of which can do this...

Link to comment
2 hours ago, gazumped said:

Hi.  Why not just use AHK (or similar) to generate the standard search and leave your cursor in the field at the correct point?  I use Phrase Express and Text Blaze (a browser add-in) both of which can do this...

That's how I'm currently doing it, with the following script in AHK:

+F6::
IfWinExist All Notebooks - xxxxx@xxxxxx.com - Evernote
    WinActivate
Send, {F6 down}
sleep, 50
Send, {F6 up}
sleep, 200
Send intitle:
return

So while F6 is the normal global search SHIFT-F6 does my special INTITLE: search

For the most part this works well but I thought if I could trigger it from a batch I avoid the always-present risk that AHK inputs the keystrokes into the wrong window due to some extraneous lag.

Slightly off topic, but if you're an AHK user, do you know if there's a way to send a hotkey to AHK from the command line? That is, using my script above is there a way to have a batch file do what SHIFT-F6 normally does?

Thanks for the help!

Link to comment

I found the a_args parameter in another hotkey section of my main AHK script (I recalled using this once before) so I'll play around with that.

@PinkElephant I've been through the dev site but couldn't locate what I'm looking for, most likely user error on my part, alas.

Link to comment
8 minutes ago, DTLow said:

For command line parameters, see the documentation at https://dev.evernote.com/doc/articles/enscript.php

I did review that but have not found the answer. Part of the problem may be that a pretty critical page appears to be defunct:

The query string is formatted according to the search grammar. To

The link above is to a reference on the dev site to search grammar. That link (to search grammar) doesn't appear to work, it is the following URL:

https://dev.evernote.com/doc/cloud/chapters/search_grammar.php

and returns an error for me from multiple browsers and machines.

image.thumb.png.a08d6fdacf52f7ac41e4427b908ae9ef.png

Link to comment

Thanks for everyone's help above. I've improved my AHK approach at least with the following:

If (A_Args[1] = "evernote_intitle")
gosub, evernote_intitle


evernote_intitle:
+F6::
IfWinExist All Notebooks - xxxx@xxx.com - Evernote
    WinActivate
Send, {F6 down}
sleep, 50
Send, {F6 up}
sleep, 200
Send intitle:
return

and now a batch file with the following line:

"C:\Program Files\AutoHotkey\AutoHotkeyU64.exe" "D:\path_to_ahk\AutoHotkey.ahk" evernote_intitle

will launch my desired intitle search as reliably as I'm currently able to do.

Would still be interested in passing the search parameters to EN but without that search grammar page I suspect I won't get much further.

Link to comment
  • Level 5*

Different approach.  WindowsKey + (number 1 to 9) will open the app in that position in the taskbar.  So something like the below should work if EN is the 8th app in line, put in AHK language.  Doesn't matter if EN is open or not, will open or go to  the window.  FWIW.

  • Win+8
  • Sleep
  • Ctrl+Shift+F
  • Sleep
  • intitle:

 

 

  • Like 1
Link to comment
6 minutes ago, CalS said:

Different approach.  WindowsKey + (number 1 to 9) will open the app in that position in the taskbar.  So something like the below should work if EN is the 8th app in line, put in AHK language.  Doesn't matter if EN is open or not, will open or go to  the window.. FWIW.

  • Win+8
  • Sleep
  • Ctrl+Shift+F
  • Sleep
  • intitle:

 

 

Always amazing when you learn something new about something you've been using for 20+ years. I am a huge fan of keyboard shortcuts but somehow never new about the WIN-1 through 8!! Very cool and I'll definitely be making use of that, thanks!!

I don't think that will work for me in this case since I nearly always have some notes open and it appears that the WIN-3 shortcut just opens whatever's at the top of the list which (annoyingly) is not necessarily the main application window.

That actually always feels like a mistake to me -- If I click on the Evernote tile on my windows taskbar (forgive me, right now I have a lot of notes open) this is what it looks like:

image.png.32bd920cdc3547ecd9723a46a1260f2e.png

I've never understood why the main application isn't at the top of the list, but in this case it makes the WIN - # shortcut unpredictable unless I have all my notes closed (not something I'm likely to achieve any time soon. :-)

Link to comment
  • Level 5*
1 hour ago, jshanker said:

I don't think that will work for me in this case since I nearly always have some notes open and it appears that the WIN-3 shortcut just opens whatever's at the top of the list which (annoyingly) is not necessarily the main application window.

Hmmm.  Just worked for me.  I opened three notes in their own windows and then went to email.  The Win hot key opened EN in the main window.  Though YMMV.

Link to comment

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
×
×
  • Create New...