Page 1 of 1

[Goodie] AutoHotKey Script to Execute Code Within a Note

Posted: Fri Mar 20, 2009 9:53 pm
by mgainer007
AutoHotKey Script to Execute Embeded Code Within a Note

The general idea behind this AutoHotKey script is to be able to execute an embedded AutoHotKey script which is contained with in a note. This allows me to create website/application login scripts.

Currently the script only supports a single embedded script within a note.

Vista users will need to run the script with admin permissions.

The hotkey for the script is Ctrl-Alt-L

The script parses the clipboard contents looking for the below code wrapper, strips out the script code and executes it.

(Can be on a single line)
AutoHotKey::<<
AutoHotKey Script Code...
>>

The steps I use for a website are the following:
  • Search for website note
  • Press Ctrl-C to copy note contents to the clipboard
  • Press F3 to launch browser with website URL
  • After website has loaded, place the cursor at the appropriate login field (if necessary) and press Ctrl-Alt-L

I also have included a couple of example hotkeys for creating note templates for logins. You could also modify the script to include the 2 and 3 steps as part of the process. For myself, I wanted something a little more generic.

Along with the script file I've included a sample batch file for launching the script.

Long Live CintaNotes!

Example Note Text

Code: Select all

This is an example website logon script

AutoHotKey::<<
SendInput {Esc}Username{Tab}pa$$word{Enter}
Sleep 5000
SendInput {Tab 10}Some secret question answer{Enter}
>>


Re: AutoHotKey Script to Execute Embeded Code Within a Note

Posted: Sat Mar 21, 2009 4:46 pm
by toddclausen
Thanks mgainer007! I'm playing with this now, changed the hotkey to a new preference. Something like this would be great added to CintaNotes as a plug-in especially in the future with encrypted notebooks!

Re: AutoHotKey Script to Execute Embeded Code Within a Note

Posted: Sat Mar 21, 2009 10:11 pm
by mgainer007
toddclausen wrote:Thanks mgainer007! I'm playing with this now, changed the hotkey to a new preference. Something like this would be great added to CintaNotes as a plug-in especially in the future with encrypted notebooks!


I currently keep CintaNotes on a encrypted USB partion. This way I only have a single password I need to remember.

Re: AutoHotKey Script to Execute Embeded Code Within a Note

Posted: Thu Apr 09, 2009 9:10 am
by CintaNotes Developer
mgainer007 wrote:AutoHotKey Script to Execute Embeded Code Within a Note


Sorry I've been able to look into this only now. That's very nice indeed! I think later it would be possible to create a special page on the site dedicated to CN+AHK extensions.

mgainer007, thanks for sharing this with everyone!