Jump to content
tavor

Autohotkey scripts for Evernote

Recommended Posts

Created a few hotkeys using AutoHotKey and figured I'd share. Feel free to share your AHK scripts. 

Each hotkey is prefaced by a description of what the hotkey does. For those not familiar with scripting, you can change the hotkey assignments and inputs like notebook name or tag name to suit your setup. If you have questions, just ask. I think there are a number of users on here who are familiar with AutoHotKey.

^e = CTRL + e

#n = WIN + n

As mentioned, those can be changed to whatever you want. ALT is ! and Shift is +

;make Evernote active 
^e::
IfWinExist, ahk_class ENMainFrame
WinActivate
return
;Evernote - local hotkeys (Evernote must be the active window)
#IfWinActive ahk_class ENMainFrame

;Create new note in default notebook without inheriting any tags (from whatever filter may be in effect). I used WIN+n as the hotkey, so it's CTRL+n when I want a new note to inherit tags and be added to whatever notebook I'm in; and WIN+n for a new note w/o any inheritance.
#n::
Send, {F6}
Sleep, 10
Send, {LControl Down}{n}{LControl Up}
return

;Insert timestamp preceded by "_Completed: " which makes it easy to search for 'completed' notes. Hat tip @csihilling
#c::
Send, _Completed:{Space}
Sleep, 10
Send, {LControl Down}{;}{LControl Up}
return

;Move to Main notebook
#m::
Send, {LShift Down}{LAlt Down}{m}{LShift Up}{LAlt Up}
Sleep, 100
Send, main
Sleep, 100
Send, {LAlt Down}{o}{LAlt Up}
WinWaitActive ahk_class ENMainFrame
return

;Toggle !!Daily tag
#d::
Send, {LAlt Down}{n}{LAlt Up}{t}{!!daily}{Space}{Enter}
WinWaitActive ahk_class ENMainFrame
return

#IfWinActive

More hotkey scripts in this thread:

Simulated internal note links

Hotkey to access Reminders function (I got sick of using the mouse for this as EN does not provide keystroke access to this function)

 

  • Like 2

Share this post


Link to post
14 hours ago, tavor said:

;Insert timestamp preceded by ">Last Completed:

Suggestion, precede Last with an underscore, _Last.  The under core is searchable in EN and this should eliminate any chance of a false positive.  FWIW

Full disclosure, I have a similar expression using PhraseExpress.  Shift-Alt-C produces _Completed 02/16/2017 11:22 AM  That phrase looks like this  _Completed {#datetime -f ddddd} {#datetime -f hh:nn AM/PM}   All the date stuff is format selection.

 

  • Like 1

Share this post


Link to post
50 minutes ago, csihilling said:

Suggestion, precede Last with an underscore, _Last.  The under core is searchable in EN and this should eliminate any chance of a false positive.  FWIW

Full disclosure, I have a similar expression using PhraseExpress.  Shift-Alt-C produces _Completed 02/16/2017 11:22 AM  That phrase looks like this  _Completed {#datetime -f ddddd} {#datetime -f hh:nn AM/PM}   All the date stuff is format selection.

 

Good call. I assumed > was searchable, but I see now that it is not. I updated the code to use _ instead of >

Yeah, I know you do, I got the idea from you - that's why I gave you a hat tip in the code. 

FYI, I created shortcuts to add reminder, mark reminder as done, change reminder date, and clear reminder. Will post in this thread once I've had a chance to clean up the code a little.

  • Like 1

Share this post


Link to post
16 hours ago, tavor said:

Created a few hotkeys using AutoHotKey and figured I'd share.

Is there something special about the !Daily tag, or just a tag you use often?

Share this post


Link to post
26 minutes ago, tavor said:

Good call. I assumed > was searchable, but I see now that it is not. I updated the code to use _ instead of >

Yeah, I know you do, I got the idea from you - that's why I gave you a hat tip in the code. 

FYI, I created shortcuts to add reminder, mark reminder as done, change reminder date, and clear reminder. Will post in this thread once I've had a chance to clean up the code a little.

Oops, missed the hat tip.  Thanks for that.  Very nice with the reminder items.

Share this post


Link to post
31 minutes ago, DTLow said:

Is there something special about the !Daily tag, or just a tag you use often?

I use the !!Daily tag for notes containing everyday small tasks. Every morning, I'll duplicate the prior day's note, and remove the !!Daily tag from the prior day's note and move it from my Todo NB to my main filing NB - by keeping historic daily tasks notes, I can track how successful I am at accomplishing these small daily tasks, which gives me information I can use in tweaking those tasks.

I actually don't use that shortcut because I just created a shortcut that:

  • duplicates yesterday's daily tasks note
  • removes the daily tag from yesterday's note
  • deletes "copy" from new note's title
  • overwrites timestamp w/ current timestamp
  • unchecks checkboxes

So now in the morning, I just run this new shortcut and my prior daily tasks note is sent to the filing NB and a new daily tasks note is created and prepped and ready to go. I can post the script if anyone is interested.

  • Like 1

Share this post


Link to post
3 minutes ago, tavor said:

Every morning, I'll duplicate the prior day's note, and remove the !!Daily tag from the prior day's note

Thanks for the details
My practice is to not copy my recurring tasks, but  I append a "Completed yyyymmdd" log to the bottom of the note

Share this post


Link to post
17 minutes ago, DTLow said:

Thanks for the details
My practice is to not copy my recurring tasks, but  I append a "Completed yyyymmdd" log to the bottom of the note

Right, that's a simpler route if you have no desire to keep a history/journal of your daily recurring tasks note. 

I'm in the process of tweaking my daily routine, so keeping a history is useful for now. 

Share this post


Link to post

Another hat tip to @csihilling for a way to simulate internal note links described here: 

I replicated this in AutoHotKey with CTRL + left mouse click to select the word, copy it and paste it into the find field.

Then CTRL + right mouse click to find next instance of the word. And you can go back with WIN + right mouse click to find previous instance of the word.

 

^LButton::  ; simulated internal note links, part 1 
Send, {Click 2}^c^f^v
return

^RButton::  ; simulated internal note links, part 2; find next
Send, !efn
return

#RButton::  ; simulated internal note links, part 3; find previous
Send, !efp
return

 

  • Like 1

Share this post


Link to post

Hotkey to access the Reminders function.

This is a bit tricky because EN's Windows app doesn't provide keystroke access to the Reminders. Even after clicking the Reminder icon, you still don't have keystroke access to navigate the menu to add, change, clear or mark as done. So all of this has to be done using mouse navigation, so the pixel counts used for said navigation will differ for different resolution monitors.

My monitors are 1920x1080 resolution, so that's what the script is written for, but it's easy to substitute your monitor's resolution. The thing you'll need to figure out is how far to adjust the Y coordinate to get the mouse pointer to be on the various Reminder menu choices. If you have a 1920x1080 monitor, nothing to change. If a different resolution, try adjusting the Y coordinate (where I have Y+80, Y+150, Y+110) by +/- 10 and see where that puts the mouse pointer - you can see the mouse pointer by, instead of using MouseClick, use MouseMove, e.g., MouseMove, left, X, Y+150 (this will move the mouse, then stop, so you can see where the pointer ends up and adjust accordingly).

Once you have it set up, the thing to note is if instead of typing in a date, you navigate to the calendar with the keyboard, that doesn't register until you hit the spacebar. (It seems the entire Reminders function was written solely for mouse operation.) Once you hit the spacebar, you'll see the date change.

The hotkey I have set as Win + F2 will add a reminder date to a note that doesn't have a reminder date. If the note already has a reminder date, the same hotkey will mark the reminder as done.

; Reminder hotkeys. Note that navigating to a particular date on calendar doesn't change the reminder date until you press spacebar, then you'll see the date changed.
#F2::  ; Add a reminder date. Mark existing reminder as done.
ImageSearch, X, Y, 0, 0, %screenWidth%, %screenHeight%, *100, %evernoteReminderPath%
MouseClick, left, X, Y
MouseClick, left, X, Y+80
return

#F3::  ; Change reminder date.
ImageSearch, X, Y, 0, 0, %screenWidth%, %screenHeight%, *100, %evernoteReminderPath%
MouseClick, left, X, Y
MouseClick, left, X, Y+150
return

#F4::  ; Clear reminder.
ImageSearch, X, Y, 0, 0, %screenWidth%, %screenHeight%, *100, %evernoteReminderPath%
MouseClick, left, X, Y
MouseClick, left, X, Y+110
return

The phrases in %% are variables. Instead of the variable, you can directly enter a fixed value. E.g., instead of %screenWidth%, you can write, e.g., 1920

And instead of %evernoteReminderPath%, you can enter the complete path to the image for imagesearch.

That said, using variables is cleaner and makes it easier to make changes, so just put this in the ahk script.

evernoteReminderPath = [full_path_to]\evernote reminders.png
screenWidth = 1920
screenHeight = 1080

Attached is the "evernote reminders" pic I used for imagesearch. You can use the same one.

evernote reminders.png

  • Like 1

Share this post


Link to post
On 2/16/2017 at 6:08 PM, tavor said:

 

Hotkey to access the Reminders function.

 

You motivated me to give it a shot with Reminders and PhraseExpress.  The coordinates in the below are based upon a two monitor set up where EN is always open on the right monitor.  Fortunately the reminder icon does note move around.  So one could adjust the coordinates to one's monitor set up.

I opted for a text string activator to be sure I was in the right note when working with the reminder.

Create/add date or Mark as done (add date and mark as done are in the same position on the screen), activate by typing rrr in the note

  • {#mouseposition -x 3280 -y 100}{#LEFTMOUSEBUTTON}{#mouseposition -x 0 -y 62 -rel}{#LEFTMOUSEBUTTON}

Change date, activated by typing rrc in the note.  

  • {#mouseposition -x 3280 -y 100}{#LEFTMOUSEBUTTON}{#mouseposition -x 0 -y 124 -rel}{#LEFTMOUSEBUTTON}

Clear reminder activated by typing rrd in the note.

  • {#mouseposition -x 3280 -y 100}{#LEFTMOUSEBUTTON}{#mouseposition -x 0 -y 93 -rel}{#LEFTMOUSEBUTTON}

EDIT:  Subsequently changed to Alt-1, Alt-2 and Alt-3 as hotkeys for the above.  Works on whatever note is in focus.  Obviously faster than typing 3 characters.

  • Like 1

Share this post


Link to post
2 hours ago, csihilling said:

You motivated me to give it a shot with Reminders and PhraseExpress.  The coordinates in the below are based upon a two monitor set up where EN is always open on the right monitor.  Fortunately the reminder icon does note move around.  So one could adjust the coordinates to one's monitor set up.

I opted for a text string activator to be sure I was in the right note when working with the reminder.

Interesting decision to use text string activator. I wrote it so that Evernote had to be the active application (so you can't accidentally change a note's reminder using the hotkey while working in another app). 

You should come to the dark side of AutoHotKey. Way more powerful and more robust - e.g., searching for the reminder image vs relying on static location and mouse coordinates. With your PhaseExpress solution, if the note taskbar is changed resulting in the remindor icon moving, the script has to be changed. With AHK's imagesearch function, as long as the reminder icon is somewhere in the EN window, it will be found. As creative as you are with shortcut hacks, moving from PhraseExpress to AHK will be like trading in a 10/22 for a Ma Deuce.  ;)

  • Like 1

Share this post


Link to post
13 minutes ago, tavor said:

Interesting decision to use text string activator. I wrote it so that Evernote had to be the active application (so you can't accidentally change a note's reminder using the hotkey while working in another app). 

You should come to the dark side of AutoHotKey. Way more powerful and more robust - e.g., searching for the reminder image vs relying on static location and mouse coordinates. With your PhaseExpress solution, if the note taskbar is changed resulting in the remindor icon moving, the script has to be changed. With AHK's imagesearch function, as long as the reminder icon is somewhere in the EN window, it will be found. As creative as you are with shortcut hacks, moving from PhraseExpress to AHK will be like trading in a 10/22 for a Ma Deuce.  ;)

More to be sure I am in the right note when I use the shortcuts.  Relative to AHK, It took me long enough to learn PE, and it's all drag and drop,... don't want to hurt myself.

I just hope the reminder icon doesn't change for you.  :P

  • Like 1

Share this post


Link to post
7 minutes ago, csihilling said:

More to be sure I am in the right note when I use the shortcuts.  Relative to AHK, It took me long enough to learn PE, and it's all drag and drop,... don't want to hurt myself.

I just hope the reminder icon doesn't change for you.  :P

I suspect you would pick up AHK quite quickly. 

In case you change your mind, here's a good beginner tutorial series: 

 

And you could start with the scripts I've posted in this thread. Tweaking them to your ends will give you a sense of how AHK's scripting language works - it's designed to be pretty user friendly.

Share this post


Link to post

\

1 hour ago, tavor said:

In case you change your mind, here's a good beginner tutorial series: 

They lost me at programming...  :)   Seriously, thanks for the link, but I will stick with the menu oriented approach.  Old dogs, horses for courses, etc.

ScreenClip.png.75e10f52cc94446f224da239a75e22e6.png

  • Like 1

Share this post


Link to post
On 17/02/2017 at 0:08 AM, tavor said:

evernoteReminderPath = [full_path_to]\evernote reminders.png

Might I suggest changing this to 

evernoteReminderPath = %A_WorkingDir%\evernote reminders.png

and placing the PNG file into the same folder as the AHK file that's used to run these hotkeys?

This helps if you sync the AHK file on different computers.

Also, I added 

SendInput {Tab}

at the end of the first 2 hotkeys to allow immediate date entry.

Otherwise thanks for your post!

  • Like 1

Share this post


Link to post

is it possible for the script to be coded dynamically such that when it detects a different resolution, the offset will be adjusted accordingly? I have 3 different setups - 4K, 1440p, and 720p. Would prefer to have 1 set of code rather than running 3 separate AHK code if possible.

Share this post


Link to post
On 10/1/2017 at 12:10 AM, Programmer said:

is it possible for the script to be coded dynamically such that when it detects a different resolution, the offset will be adjusted accordingly? I have 3 different setups - 4K, 1440p, and 720p. Would prefer to have 1 set of code rather than running 3 separate AHK code if possible.

I've never looked into it, but I'd guess that AHK can be used to detect monitor resolution and choose the offset you've coded for that particular resolution. AHK forum is a very helpful resource.

Share this post


Link to post

IS it possible to write a script to generate a delete confirmation dialog when hitting the delete / backspace key?

Share this post


Link to post
2 hours ago, eric99 said:

IS it possible to write a script to generate a delete confirmation dialog when hitting the delete / backspace key?

You can probably do this, but it seems kinda drastic: it's going to be pretty tedious for a person who's actually validly editing a note (and it won't do anything for right-click menu-based cut/paste operations). Unless you're trying to prevent deletion from the note list, in which case you might be able to constrain the dialog to only pop up when those keys are pressed in the note list, but again, right-click Delete is not prevented either in that case.

  • Like 1

Share this post


Link to post
1 hour ago, jefito said:

You can probably do this, but it seems kinda drastic: it's going to be pretty tedious for a person who's actually validly editing a note (and it won't do anything for right-click menu-based cut/paste operations). Unless you're trying to prevent deletion from the note list, in which case you might be able to constrain the dialog to only pop up when those keys are pressed in the note list, but again, right-click Delete is not prevented either in that case.

The dialog should offer the choice to switch off next confirmation popups or not...

Or maybe better, it should be possible to switch it on or off from the quick launch toolbar

But  just suppressing the delete button would already be an improvement; accidental right-click menu-based cut/paste operations are less likely to occur.

 

Share this post


Link to post

In the mean time I have a first AHK script that prevents accidental deletion within a note or the complete note. The search box is excluded and can still be used as before. I'm really getting  exited about AHK's capabilities and will improve my script that you can easily switch on-off the protection.

Share this post


Link to post

The attached script contains my first implementation for edit / delete confirmation of existing notes (still in Beta )

;===================================================================================
;
; The script starts up in ReadOnly mode.
;
; When you start a new note (CTRL-N) editing is enabled.
;
; When you start editing an existing note, an edit-confirmation dialog pops up.
; Once you confirm edit mode, editing will stay enabled as long as you keep typing at
; a minimum rate (default=60 seconds between keystrokes, specified in NextKeyTimeout_ms)
; or till you leave note editing by clicking on another control (other than a note).
;
; So if you just switch between two open notes, editing stays enabled.
; Also if you switch beween an external application and a note, editing stays enabled as well.
; Of course, there is always the timeout safety net that switches to readonly when no editing
; activity detected for NextKeyTimeout_ms time.
;
; Search boxes and autocomplete boxes (tags...) stay always enabled.
;
;====================================================================================

I created this script to protect our "paperless home" against accidental deletion, mostly by my kids when using our database (regulary as reader, sometimes as data provider). Our database contains important documents we can't afford to loose and sometimes a user doesn't realize that something has been deleted, especially if one is missing from a bunch of attachments.

The script is not intended to protect against deliberate destruction but more against deletion while reading the notes (especially while clicking on attachments, navigating through the notes, switching between evernote and other applications and hitting the keyboard simultaneously etc)

The next days I'll  evaluate the proper balance between usability and protection.

All feedback is welcome

Eric

 

Evernote.ahk

Share this post


Link to post
2 hours ago, eric99 said:

accidental deletion, mostly by my kids when using our database

Also watch out for cats walking across the keyboard :)

This may be beyond the scope of AHK; there's a field (contentClass) that can be toggled to set a note as read-only
This is metadata, and requires a direct update of the database.
I could script this on a Mac

There's documentation at https://dev.evernote.com/doc/articles/read_only_notes.php

Confession; There are no kids (or cats).  It's me accidently editing my notes

Share this post


Link to post
13 hours ago, DTLow said:

Also watch out for cats walking across the keyboard :)

You laugh, but early in my programming career, a colleague's baby daughter "discovered" a fatal bug in the software we were writing (a word processor) by sitting on the space bar for awhile...

Share this post


Link to post

 

 Attached the updated AHK script  with optimized balance between editing comfort and write protection

;===================================================================================
;
; Version 0.0.15
;
;Evernote Edit Confirmation script
;
; The script starts up in ReadOnly mode.
;
; When you start a new note (CTRL-N) editing is enabled.
;
; When you start editing an existing note, an edit-confirmation dialog pops up.
; Once you confirm edit mode, editing will stay enabled as long as you keep typing at
; a minimum rate (default=60 seconds between keystrokes, specified in NextKeyTimeout_ms)
; or till you select another note in the note list.
; So if you just switch between two open notes, editing stays enabled.
; Also if you switch beween an external application and a note, editing stays enabled as well.
; There is always the timeout safety net that switches to readonly when no editing
; activity detected for NextKeyTimeout_ms time.
;
; Search boxes and autocomplete boxes (tags...) stay always enabled.
;
;====================================================================================

Already compatible with Evernote 6.11.2.7027 (307027)

 

EditConfirmation .ahk v0.0.15

Share this post


Link to post

I'm looking for a script snippet to format a datestamp as superscript and then return to normal text in Evernote using Autohotkey.

The key stroke in Evernote to make selected text superscript is Ctrl+Shift+Uparrow. 

^#!f8::
FormatTime, Time,, _yyMMdd-HHmm.ssε
SendInput %Time%
return

I've got the datestamp part working just fine but cannot how to put it into superscript. 

Help, please.

Thanks

 

Share this post


Link to post
On 6/13/2018 at 12:18 PM, Ataraxius said:

I'm looking for a script snippet to format a datestamp as superscript and then return to normal text in Evernote using Autohotkey.

The key stroke in Evernote to make selected text superscript is Ctrl+Shift+Uparrow. 

^#!f8::
FormatTime, Time,, _yyMMdd-HHmm.ssε
SendInput %Time%
return

I've got the datestamp part working just fine but cannot how to put it into superscript. 

Help, please.

Thanks

 

Send, {Ctrl}{Shift}{Up}

Does that not work?

Share this post


Link to post

@Super Guru-

Thanks for your suggestion, but Evernote does not seem to recognize it at all . I just get the date in the regular font. 

^#!f5::
FormatTime, Time,, yyMMdd-HHmm.ss
Send, {Ctrl}{Shift}{Up}
SendInput %Time%
Send, {Ctrl}{Shift}{Down}
return

This simply produced the datestamp in the default font, not as superscript.

I also tried:

^#!f4::
FormatTime, Time,, yyMMdd-HHmm.ss
Send, {Ctrl}{b}
SendInput %Time%
Send, {Ctrl}{b}
return

This simply generated the datestamp with a (literal) "b"  before and after it.  I.e. Autohotkey is seeing the "b" key as an alphabetic and not as a control character.

More suggestions?  (Thanks for your help!!)

Share this post


Link to post
19 minutes ago, Ataraxius said:

@Super Guru-

Thanks for your suggestion, but Evernote does not seem to recognize it at all . I just get the date in the regular font. 

^#!f5::
FormatTime, Time,, yyMMdd-HHmm.ss
Send, {Ctrl}{Shift}{Up}
SendInput %Time%
Send, {Ctrl}{Shift}{Down}
return

This simply produced the datestamp in the default font, not as superscript.

I also tried:

^#!f4::
FormatTime, Time,, yyMMdd-HHmm.ss
Send, {Ctrl}{b}
SendInput %Time%
Send, {Ctrl}{b}
return

This simply generated the datestamp with a (literal) "b"  before and after it.  I.e. Autohotkey is seeing the "b" key as an alphabetic and not as a control character.

More suggestions?  (Thanks for your help!!)

Try selecting the text, then sending the EN shortcut.

As a simple proof of concept, have a hotkey that only sends {Ctrl}{Shift}{Down}. Then, in EN, write some text or datestamp, select it, then try the hotkey. If that works, incorporate the text selection into your script.

Share this post


Link to post

Ah!!! Found it! This seems to do the trick:

^#!f5::      ; hold down Ctrl+Win+Alt and then press F5 key to trigger this
FormatTime, Time,, yyMMdd-HHmm.ss     ; this is my "special" format. You may have a different format
Send, ^+{up}     ; send Ctrl+Shift+Up arrow to start superscript font
SendInput %Time%   ; insert date stamp
Send, ^+{up}     ; send ctrl-shift+uparrow to end superscript mode
return

The result looks like this:   TEST datestamp TEST  or, using my datestamp format, TEST180620-0924.33TEST

This makes is real easy to poke in a time reference when I add annotations to existing notes, etc. Very useful.

  • Like 1

Share this post


Link to post
1 minute ago, Ataraxius said:

Ah!!! Found it! This seems to do the trick:

^#!f5::      ; hold down Ctrl+Win+Alt and then press F5 key to trigger this
FormatTime, Time,, yyMMdd-HHmm.ss     ; this is my "special" format. You may have a different format
Send, ^+{up}     ; send Ctrl+Shift+Up arrow to start superscript font
SendInput %Time%   ; insert date stamp
Send, ^+{up}     ; send ctrl-shift+uparrow to end superscript mode
return

The result looks like this:   TEST datestamp TEST

Awesome. And thanks for providing the well-commented script that others can use or incorporate into their own scripts.

Share this post


Link to post

Sometimes EN seems to ignore key sequences from AutoHotkey because they are coming too fast. In this case you should insert some sleep()s to slow down key press speed. Here's an example of a script that starts a checklist if you type "td "

:oc:td::
    Sleep 100
    Send, ^{b}
    Sleep 100
    Send, Todo:^{b}
    Sleep 100
    Send, {Enter}^+{b}
    Sleep 100
    Send, ^+{c}
    Return

Result is

Quote

Todo:

  • [_] 

Without the sleep() statements sometimes "Todo:" is not bold or the list is not started or checkbox is not there ;-)

  • Like 1

Share this post


Link to post

I'm new to autohotkey.  Why does this send a D instead of a  control - D inside a note?   Thanks

#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.

^+R::
Send, {Ctrl}D
return

 

Share this post


Link to post

Don't know exactly, why (AHK uses some surprising syntax). But it works if you write

^+R::
    Send ^{d}
    return

 

Share this post


Link to post

Thank you Eldorado, I was really getting tired of guessing the syntax - the help file is not robust

Share this post


Link to post

I needed a quick way to change text color inside a note using autohotkey. This works for me: changing text to red:

#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.

; Use   alt-cntrl-R

^+R::
Send ^{d}
Sleep 500
Send  !{c}
Send {r}
Sleep 500
Send {Enter}
return

 

  • Like 1

Share this post


Link to post
On 2/15/2017 at 10:35 PM, tavor said:

 


;make Evernote active 
^e::
IfWinExist, ahk_class ENMainFrame
WinActivate
return

 

I was curious about this one, copied and pasted it as is, no response, changed the hotkey, no response. 

I wonder if something changed in either EN or AHK.

I did check for conflicting hotkeys within AHK, though even a conflict should have produced some kind of action or fireworks.

Although nowhere near expert level, I have many working hotkeys, so I am reasonably confident I know how to use AHK with EN.  :ph34r:

Share this post


Link to post
On 9/6/2018 at 9:25 PM, Don Dz said:

I was curious about this one, copied and pasted it as is, no response, changed the hotkey, no response. 

I wonder if something changed in either EN or AHK.

I did check for conflicting hotkeys within AHK, though even a conflict should have produced some kind of action or fireworks.

Although nowhere near expert level, I have many working hotkeys, so I am reasonably confident I know how to use AHK with EN.  :ph34r:

Still works for me. Running AHK v1.1.26.01

It's such a simple script that if you're running into an issue, I would be looking for a hotkey/shortcut conflict. Don't just check AHK, check other programs as well. Or switch to a hotkey you are certain no other programs are using.

Share this post


Link to post
On 9/14/2018 at 7:35 AM, tavor said:

Still works for me. Running AHK v1.1.26.01

It's such a simple script that if you're running into an issue, I would be looking for a hotkey/shortcut conflict. Don't just check AHK, check other programs as well. Or switch to a hotkey you are certain no other programs are using.

I found that it works if EN is open in a background window, but not if it is in the system tray only.  Is that how it is intended to work?

  • Like 1

Share this post


Link to post
2 hours ago, Don Dz said:

I found that it works if EN is open in a background window, but not if it is in the system tray only.  Is that how it is intended to work?

Well, at a guess, in that case, the Evernote application isn't running then, and the Evernote window (presumably the 'ENMainFrame' window class in the script isn't around, so it can't be activated.

I suppose if that's the case, then the AHK script could try to launch the Evernote application...

  • Like 1

Share this post


Link to post
16 hours ago, jefito said:

Well, at a guess, in that case, the Evernote application isn't running then, and the Evernote window (presumably the 'ENMainFrame' window class in the script isn't around, so it can't be activated.

I suppose if that's the case, then the AHK script could try to launch the Evernote application...

Exactly. 

;make Evernote active 
^e::
IfWinExist, ahk_class ENMainFrame
WinActivate
return

The script is looking for windows of class ENMainFrame, which don't exist when the main app isn't running.

As @jefitosuggests, you could modify the script so that it checks for two states; if ENMainFrame exists, make it active; if it doesn't exist, launch the app.

By way of background, I created this because my use case is I always have EN running, but it often isn't the active window (which will be the case for anyone who uses other apps frequently), so the script is just a quick way to make EN the active window so I can do whatever (create new note, search for a note, etc.) without having to use the mouse to click on the EN icon or use ALT-TAB to find EN among the many apps I have running.

  • Like 1

Share this post


Link to post
2 hours ago, tavor said:

As @jefitosuggests, you could modify the script so that it checks for two states; if ENMainFrame exists, make it active; if it doesn't exist, launch the app.

Share this post


Link to post
4 hours ago, tavor said:

The script is looking for windows of class ENMainFrame, which don't exist when the main app isn't running.

I understand.  The state of programs on the System Tray and their reaction or lack thereof to hotkeys isn't always very clear.   

In any case, might as well just press Win-Shift-F than to muck with it too much, or reduce the script to pressing that after pressing F2.  Besides I am not yet familiar with the AHK Else statement.

Share this post


Link to post
On 2/16/2017 at 1:11 PM, tavor said:

I use the !!Daily tag for notes containing everyday small tasks. Every morning, I'll duplicate the prior day's note, and remove the !!Daily tag from the prior day's note and move it from my Todo NB to my main filing NB - by keeping historic daily tasks notes, I can track how successful I am at accomplishing these small daily tasks, which gives me information I can use in tweaking those tasks.

I actually don't use that shortcut because I just created a shortcut that:

  • duplicates yesterday's daily tasks note
  • removes the daily tag from yesterday's note
  • deletes "copy" from new note's title
  • overwrites timestamp w/ current timestamp
  • unchecks checkboxes

So now in the morning, I just run this new shortcut and my prior daily tasks note is sent to the filing NB and a new daily tasks note is created and prepped and ready to go. I can post the script if anyone is interested.

Would you mind posting the script? I found this old post while searching for help creating something nearly identical to what you're describing.

Share this post


Link to post
On 12/10/2017 at 5:12 PM, eric99 said:

 

 Attached the updated AHK script  with optimized balance between editing comfort and write protection

;===================================================================================
;
; Version 0.0.15
;
;Evernote Edit Confirmation script
;
; The script starts up in ReadOnly mode.
;
; When you start a new note (CTRL-N) editing is enabled.
;
; When you start editing an existing note, an edit-confirmation dialog pops up.
; Once you confirm edit mode, editing will stay enabled as long as you keep typing at
; a minimum rate (default=60 seconds between keystrokes, specified in NextKeyTimeout_ms)
; or till you select another note in the note list.
; So if you just switch between two open notes, editing stays enabled.
; Also if you switch beween an external application and a note, editing stays enabled as well.
; There is always the timeout safety net that switches to readonly when no editing
; activity detected for NextKeyTimeout_ms time.
;
; Search boxes and autocomplete boxes (tags...) stay always enabled.
;
;====================================================================================

Already compatible with Evernote 6.11.2.7027 (307027)

 

EditConfirmation .ahk v0.0.15

This edit confirmation script is compatible with 6.16.4.8094 (308094) Public (CE Build ce-58.1.6897)

  • Like 1

Share this post


Link to post
On 11/2/2018 at 2:52 PM, mtnbnd said:

Would you mind posting the script? I found this old post while searching for help creating something nearly identical to what you're describing.

I don't use that script anymore because I dropped the process I had around that "daily" note. I don't see the code in my script file, so I must have deleted it. It's fairly simple to create as it just sends keystrokes to access menu options, tab, etc. You will have to insert pauses because without them, the sequence of keystrokes you send can outrun EN's ability to execute them.

Again, it's simple - just look at every action you'd have to take to manually accomplish these actions using the keyboard. Then write the script to send those keystrokes (build up the script one step at a time, and add pauses as necessary to ensure reliable execution). If you run into issues, just post them here, and someone here can probably figure out the problem.

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

×