Jump to content

Quick Format with Hotkey


Recommended Posts

2 hours ago, AirplaneGuy said:

I would like to be able to quick format a note using a hot key. For instance, I would like to be able to tag a note "read" and move it to the "Articles" notebook with one keystroke. Is there an easy way to currently do this with a single keystroke? 

It is possible, at least if you're creative enough. 

Look into the program called AutoHotKey (Windows only, don't know of a Mac variant). In that you can assign any hotkey of choice to do a set of tasks, so you can make it do the commands to tag as read and move to articles. However, you would have to script this yourself. It would be something like this:

^+1:: ; Hotkey is Ctrl^ Shift+ 1
	Send ^!t
	Send {tab 3}
	Send read
	Send {enter}
	ControlClick, Ok

	Send !+m
	Send articles
	Send {enter}
return

Good luck :)

I don't know if you can change your title at this point, but I wouldn't call that task formatting, but organising. Formatting would be text formatting, bold, red, 12pt etc. 

Link to comment
  • Level 5*
42 minutes ago, MySecretUser said:

It is possible, at least if you're creative enough. 

Yeah, I left out that one (and its competitor, whose name I can't recall).

I might even be creative enough, but I'm lazy...

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

Look into the program called AutoHotKey (Windows only, don't know of a Mac variant).

We're covered on the Mac - there's a builtin AppleScript feature

Link to comment

Thanks for the help. I tried Autohotkey but I cannot seem to reliably get it to click the buttons...

Here is what I have but I have to manually click the "move" button at the end of the script.  The send tab, send {enter} do not work there.  I tried ControlClick, MouseClick but can't seem to get those commands to work.  Also it does not add the Read tag sometimes. 

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

^+1:: ; Hotkey is Ctrl^ Shift+ 1
	Send ^!t
	Send {tab 4}
	Send read
	Send {tab 1}
	Send {enter}
	Send {tab 1}
	Send {enter}

	Send !+m
	Send articles

return

 

Link to comment

Got it to work (mostly). Turns out the program that Autohotkey has to tell you the relative cursor location tells you the position from the "Assign Tag" box, but the program wants it relative from the top of the Evernote window. I had to put screenshots into Photoshop to see what the X,Y coordinates are. 

Now it works except I still need to left click or hit enter in the move to notebook window.  A huge improvement from before.

 

Would be really awesome if this was built into Evernote and consistent across my Mac and PC. 

 

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

^+1:: ; Hotkey is Ctrl^ Shift+ 1
	Send ^!t
	Send {tab 4}
	Send read
	Click, 380, 260
	Click, 300, 310

	Send !+m
	Send articles
	Send {enter}
	Mousemove, 460, 570

return

 

Link to comment

Timing can be critical with AHK, as it happens almost instantaneous and people are much slower (tip below for this). I tested this and have a fix which doesn't use the clicks. The use of clicks is dangerous when using variables like that, as on different screen sizes and window positions the values can change. With that I prefer to avoid using them, I don't want to have to recreate all scripts if I change my screen or use another computer.  

I have added a delay before sending the enter key, which gives Evernote 1sec to get the right notebook up and then sends the enter key on the complete word. I have also added application framing, so that that hotkey will only fire when you're within Evernote (so you can use the same hotkey for different uses in different applications, without those it works globally). 

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

GroupAdd, Evernote, ahk_class ENMainFrame ; Evernote
GroupAdd, Evernote, ahk_class ENSingleNoteView ; Evernote
#IfWinActive, ahk_group Evernote
^+1:: ; Hotkey is Ctrl^ Shift+ 1
	Send ^!t
	Send {tab 4}
	Send read
	Send {tab 1}
	Send {enter}
	Send {tab 1}
	Send {enter}

	Send !+m
	WinWait Move Note to Notebook
	Send Journal
	Sleep 1000
	Send {enter}
return
#IfWinActive

If you want to keep the click, I would take a look at ControlClick, it can be used to click a button based upon the button text (Move, Ok, Cancel). But if Evernote is still pulling up the notebook from your search a delay would still be needed. 

For good timing, such as a waiting for a window, you can use WinWait+box title, WinWait Move Note to Notebook. This will pause the script until a window with the title is in focus, which is great if a window can take a while to load.

Hope that helps. 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...