Menu

#52 Clipboard variable for arguments

open
General (22)
5
2012-08-19
2012-01-10
No

I use MadAppLauncher more and more.
But I still use AutoHotKey or AutoIT for a very useful function - conducting web searches for highlighted words.
eg:
in AutoCorrectMe.ahk
^+u::
Send, ^c
Sleep 50
Run, http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=pubmed&term=%clipboard%
return
and
in AutoCorrectMe.ahk
^+g::
Send, ^c
Sleep 50
Run, http://www.google.com/search?q=%clipboard%
return
Looking for a new house, I am using Google Earth a lot, so I was going to make one for that, when it occurred do me that it is a pity MadAppLauncher doesn't have a %clipboard% that I can use.
I know it departs a little from the simplicity of the program, but perhaps it can be buried deep in the documentation where less sophisticated users can't find it.
TIA
Jim

Discussion

  • JimJimJimJim

    JimJimJimJim - 2012-01-11

    That should have been 'Google Maps' - a website, not 'Google Earth' which only takes Google Map file names as arguments.

     
  • madproton

    madproton - 2012-01-11

    Hi Jim,

    This is very easy to implement so I added it. There are a few concerns though...

    1. If the current item selected cannot be copied to clipboard (eg. windows, buttons, etc.), an error beep is initiated. This can get really irritating. I also use AHK but much less now since I created MAL. AHK also beeps in the same scenario. That beep is a system beep which makes it hard to circumvent without introducing other potential problems. It cannot be turned off temporarily(as far as I know) since Windows is causing it and not MAL. One solution, is to have a Settings/Option to automatically copy the highlighted item/text to the clipboard when activating MAL.

    If the option is on, MAL will autocopy the highlighted item before activating. One major problem with this is that MAL autocopies even if the user is not intending to use this search type substitution feature. The ctrl+c needs to be sent before the MAL window is activated.

    If the option is off, the user needs to select and ctrl+c the item before launching MAL. This seems to be cleaner but requires the user to remember to ctrl+c first.

    1. The autocopy portion of the feature will only work if MAL is activated via the hotkey. Clicking the takbar button(if shown) or the notification/tray icon will not work because these actions will make MAL the active window before firing the copy command.

    I need to think about this a bit more... If you have any suggestions, please let me know.

    Thanks.

    -
    madproton

     
  • JimJimJimJim

    JimJimJimJim - 2012-01-11

    How about having a second hotkey which is only used on those occasions when wishing to use %clipboard% ?

    If standardHotkey
    --- regular process
    If clipboardHotkey
    --- copy selection in active window
    --- regular process

    So, for me, I would have
    hotkey: backtick
    Clipboard hotkey Ctrl+click

    And to run Notepad, I might use
    backtick, N key
    But to run Google with a highlighted phrase
    Ctrl-backtick, G key

    To keep this clipboard hotkey away from less sophisticated users:
    On hotkey dialog, under Activate tab:
    --- checkbox Advanced (default unchecked)
    Checking Advanced checkbox reveals:
    --- checkbox Use clipboard (default unchecked)
    --- repeat of hotkey assignment fields, labeled 'Clipboard Hot Key Assignment'

     
  • JimJimJimJim

    JimJimJimJim - 2012-01-11

    Woops!
    Clipboard hotkey Ctrl+click
    should read
    Clipboard hotkey Ctrl+backtick

     

Log in to post a comment.

MongoDB Logo MongoDB