ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > N.A.N.Y. 2015

Program Idea: Configurable application launcher

<< < (2/3) > >>

Masonjar13:
Personally, I use ObjectDock for quick-launching applications. Someone would have to compete with that, which wouldn't be a challenge if they could make it actually hide instead of just go into negative coords with auto-hide. Makes multi-monitor setups a real hassle  >:(. Plus, if it's on the side anyway, the mouse will float into the next screen before it un-hides it, so.. Maybe a key-board shortcut to hide it? Of course, AHK could do that with ObjectDock. Hmm..

MilesAhead:
Personally, I use ObjectDock for quick-launching applications. Someone would have to compete with that, which wouldn't be a challenge if they could make it actually hide instead of just go into negative coords with auto-hide. Makes multi-monitor setups a real hassle  >:(. Plus, if it's on the side anyway, the mouse will float into the next screen before it un-hides it, so.. Maybe a key-board shortcut to hide it? Of course, AHK could do that with ObjectDock. Hmm..
-Masonjar13 (December 11, 2014, 07:59 PM)
--- End quote ---

In this case I think the OP is really interested in a browser picker more than anything.  I don't remember if I ever tried ObjectDock.  I used RocketDock for quite awhile.

MilesAhead:
I dunno'.  You can change the hotkey for Selector to a single key by backspacing to delete the modifier key when the Set Hotkey dialog comes up(Set Hotkey tray menu command.)  This would allow launch with one key such as Pause or Numpad * if not using those.  I guess I should have included mouse hotkeys but I wrote that program in AutoIt3 which has poor mouse support.  Later on I took to making  slave ahk programs to handle the mouse action when a mouse hotkey was needed.

I haven't seen much in the way of scraping a url from any window.  Probably because there are just too many window and dialog types to do it cleanly.

Selector may still be downloaded but I've stopped developing anything longer than a few lines until I get a desktop machine and a desk to put it on.  A Laptop even with a USB external keyboard is just too cumbersome when I can't count on being able to stay at it for anything longer than about a 1/2 hour.  It's just not feasible.

MilesAhead:
Looking through my general purpose hotkey file I see I have done some stuff that may be helpful here.  I used excerpts to make this script.  Just testing briefly it seems to work on Windows 8.0.  It opened urls with chromium and opera through BrowserBunch.

( Note: next paragraph edited to reflect the new hotkeys actually in the script.  The Windows key has been removed as a modifier since it can trigger the Start Screen in Windows 8 and later. )

You can either select a url and hit Control Shift F4 to launch BrowserBunch with the selection as arg, or if in an editor place the caret at the start of the url and press Control Shift F3.  In the latter case the url must be at the end of the line as I just send Shift End to select it.  Note that Control Shift F4 is also useful to open the url in the AddressBar in another browser.  Most browsers can be set to select the address if you click the mouse into the AddressBar.  Once selected press Control Shift F4 and the BrowserBunch Gui should pop up.

Just scraping from any caret position is messy since pressing Control Left or Right stops at periods as well as white space so no easy way to detect where the url ends.  It's pretty easy to click to the start and hit the hotkey.

Add window classes to the EditorGroup section to support more editors and browsers.  Edit the path to BrowserBunch.exe to match the path on your system.  Run the script with ahk or use ahk to compile to exe.  At this point I haven't added a custom icon as I will probably just paste the code into my catch all hotkey script.  But you can add an icon for the tray if you wish.

Note that on Windows Vista and later it may be a good idea to put BrowserBunch.exe in an empty folder not under Program Files since it writes an .ini file to the same folder.  Vista and later don't like this and you may have to take ownership etc..  I find it easier for these types of scripts to put them under a folder I created C:\Utils in a separate folder for each script.  This also helps avoid spaces in file paths etc..


I've named the file LaunchBB.ahk


--- ---#SingleInstance force
#NoEnv
#Warn UseUnsetLocal, Off
DetectHiddenWindows, On
SetTitleMatchMode,2
SendMode Input
SetWorkingDir %A_ScriptDir%

; Editors and Browsers to Launch BrowserBunch from
GroupAdd,EditorGroup, ahk_class TFormEditPadLite  ;EditPadLite
GroupAdd,EditorGroup, ahk_class TFormEditPadLite7 ;EditPadLite7
GroupAdd,EditorGroup, ahk_class wxWindowClassNR   ;FBIde
GroupAdd,EditorGroup, ahk_class SciTEWindow       ;Scite
GroupAdd,EditorGroup, ahk_class MAINFBEDIT        ;FBEdit
GroupAdd,EditorGroup, ahk_class Notepad           ;Notepad
GroupAdd,EditorGroup, ahk_class TFormMain         ;TreePad
GroupAdd,EditorGroup, ahk_class Chrome_WidgetWin_0   ;Chromium Browser
GroupAdd,EditorGroup, ahk_class Chrome_WidgetWin_1   ;Chromium 20.x
GroupAdd,EditorGroup, ahk_class MozillaUIWindowClass ;Firefox Browser
GroupAdd,EditorGroup, ahk_class MozillaWindowClass   ;Firefox 4+ Browser
GroupAdd,EditorGroup, ahk_class OperaWindowClass     ;Opera 11
GroupAdd,EditorGroup, BBCeditor ; BBCeditor

 #IfWinActive ahk_Group EditorGroup
 ; Launch BrowserBunch with Selection as arg
^+F4::
  ClipSave := Clipboard
  Clipboard := ""
  Send, ^c
  ClipWait,2
  ; set BrowserBunch path for your system
  Run C:\Utils\BrowserBunch\BrowserBunch.exe %Clipboard%
  Clipboard := ClipSave
  ;MsgBox % Clipboard
return

; Launch BrowserBunch with url
; Note caret must be immediately left
; of the entire url and url must be at the
; end of a line
^+F3::
ClipSave := Clipboard
 Clipboard =
  Send,+{End}
  Sleep,10
  Send,^c
  ClipWait,2
  Send,{Right}
   ; set BrowserBunch path for your system
  Run C:\Utils\BrowserBunch\BrowserBunch.exe %Clipboard%
  Clipboard := ClipSave
return

Let me know if you find a bug.  :)

MilesAhead:
By the way, if 6 browser Buttons aren't enough you can just create another folder and copy the contents of the first BrowserBunch folder.  In LaunchBB.ahk copy the hotkey sections and change them to use a different hotkey to launch from the secondary folder.  To remove a browser from a button just blank out the line after the '=' sign in the .ini file for that button.

Edit:  Another thing to note is that ahk has good mouse "hotkey" support.  Instead of pressing Control Shift F4 to launch with the selection you could change the hotkey to "+MButton" or Shift middle click etc..

See ahk help for hotkey codes.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version