topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 6:12 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Program Idea: Configurable application launcher  (Read 11609 times)

Writer

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 22
    • View Profile
    • Donate to Member
Program Idea: Configurable application launcher
« on: December 11, 2014, 09:57 AM »
This is my first idea suggestion for NANY. I have probably searched and tried out most of the available ones: including BrowserChooser and BrowserChooser2 (the latter started as a fork of the former, but now appears abandoned).

I've also tried using Selector a while back when the Favessoft was available. But I find it takes too many actions.

Browser selectors were a fairly frequent request here on DC:
IDEA: Choose which browser will open a url from external app (here)
IDEA: Shell extension which would let you choose which browser opens a hyperlink (here)

Coming back to the idea. I've no programming experience, but can help with UI reviews. Also after reading through many threads, I assume creating a configurable launcher is probably not an easy task.

Nevertheless, here's what could be a useful tool:
1. When a user performs a specific click (say Ctrl+Middle-click) on a URL, a quick selector is displayed. Instead of a mouse click, a similar action could be performed using the keyboard (say a Ctrl+Shift+Return on the keyboard).
2. A user should have the ability to specify that some domains directly open up in a specific browser. This particular feature might be a quite a bit of coding, I reckon.

Looking forward to hearing your thoughts.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #1 on: December 11, 2014, 11:54 AM »
I have modified BrowserBunch.exe so that if it is run with the first argument on the command line not ending in ".txt" it will assume it is a url, rather than a text file list of urls,  and will open the BrowserBunch Gui.

The Gui can handle up to 6 Browsers using Buttons.  Clicking on a blank button opens a file open dialog to browse to the executable.  The Browser Button will load the icon from the exe and save the info to an .ini file.

The bridge that would be required would be something that detects a url in an editor or whatever and calls BrowserBunch with the url as argument.

Here's a screen shot of the BrowserBunch Gui with 4 Buttons initialized.

Edit:  I've added a zip with just BrowserBunch.exe that has been modified in case you wish to experiment with it.  It should be run from an empty folder since it will create a file BrowserBunch.ini there and needs to find that file or it may quit with an error.


BrowserBunch.jpg

After a Button is clicked the corresponding browser is run with the url as argument.


I know it seems a bit involuted but I have this mechanism for choosing from several browsers pretty well debugged.  If it seems an acceptable Gui then it may be worth considering using a hotkey for the url detection etc..


Edit2:  Note that the first time the BrowserBunch Gui comes up if it detects no initialized buttons it will offer to load the leftmost button with the default browser.  Just so you expect it.  :)

Edit3:  The BrowserBunch Gui only shows translucent as in the screen shot, on Windows 7 with Glass enabled.


« Last Edit: December 11, 2014, 12:12 PM by MilesAhead »

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #2 on: December 11, 2014, 01:58 PM »
The bridge that would be required would be something that detects a url in an editor or whatever and calls BrowserBunch with the url as argument.

I think you are making it a little more complicated than it needs to be.

You just need an executable that can be set as the default browser, whose sole purpose is to pop up a panel of options and then pass the URL to the browser chosen by the user.

Set as the default browser, it would pick up anything that isn't a link clicked within an actual browser. It wouldn't even need to be running in the background at all times, as the system would launch it as it passes it the URL as a command line parameter, as needed.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #3 on: December 11, 2014, 03:46 PM »
The bridge that would be required would be something that detects a url in an editor or whatever and calls BrowserBunch with the url as argument.

I think you are making it a little more complicated than it needs to be.

You just need an executable that can be set as the default browser, whose sole purpose is to pop up a panel of options and then pass the URL to the browser chosen by the user.

Set as the default browser, it would pick up anything that isn't a link clicked within an actual browser. It wouldn't even need to be running in the background at all times, as the system would launch it as it passes it the URL as a command line parameter, as needed.

I know.  That's how Browser Chooser worked.  I looked into it and setting the defaults for all the various html related stuff is more complicated than all the rest of it.  I only say use a bridge to call my program because it is already debugged.  I suppose I could add using selected text but then you would either have to select the entire url or I would have to add the logic to my program.  It would be simpler to do a hotkey to get the url and call my program.  Also there's no risk of breaking my code that way.

For some reason Windows users hate it if everything is not in one exe whereas in Linux type OS tools are strung togethr all the time.  I can understand some paranoia like not wanting to install 4 different frameworks or something.  But I would venture a guess there's already a tray program out there somewhere that gets the entire url if you click on any part of it in the active window.

Edit: for example this snippet highlights the word to the left of the caret then sends it to the free dictionary when control-F9 is pressed.  It could be changed to launch BrowserBunch and the URL pretty easily.

^F9::
  Clipboard =
  Send,^{LEFT}^+{RIGHT}
  Sleep,10
  Send,^c
  ClipWait,0
  Selected := Clipboard
  Send,{Right}
  Run,http://www.thefreedictionary.com/%Selected%
return

Edit2:  The above would have to be enhanced to save and restore clipboard contents as well as load a pretty icon in the tray and perhaps an About function.  I'm a very slow coder.  That's a major reason I often suggest directions.  Most have a working prototype by the time I get the editor fired up.  :)

Edir3:  The code above was for looking up words in the dictionary from an edit form in a browser, such as I'm using right now, or some kind of text editor.  If you cannot count on the keys being there to select text via macro then you are back to selecting the entire url with the mouse etc..  Making something that can pull from every type of window gets sticky.
« Last Edit: December 12, 2014, 09:38 AM by MilesAhead »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #4 on: December 11, 2014, 04:27 PM »
btw once you run BrowserBunch to generate the .ini file you can just paste in the paths to the browsers you wish to use if that's easier han going through the button click initialization.  Also it has a /setup switch to go through the button setup all at once etc..

Masonjar13

  • Participant
  • Joined in 2014
  • *
  • Posts: 35
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #5 on: December 11, 2014, 07:59 PM »
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..
Tox ID: 065459DFC23CA5D238F2334168150B8727B1D0826C80DD2F49F35B612B401A0837F89E7C9C86

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #6 on: December 12, 2014, 05:44 AM »
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..

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

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #7 on: December 12, 2014, 10:12 AM »
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.

« Last Edit: December 12, 2014, 10:19 AM by MilesAhead »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #8 on: December 13, 2014, 10:37 AM »
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.  :)
« Last Edit: December 13, 2014, 11:22 AM by MilesAhead »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #9 on: December 14, 2014, 05:52 AM »
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.
« Last Edit: December 14, 2014, 08:33 AM by MilesAhead »

Writer

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 22
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #10 on: December 15, 2014, 04:25 AM »
Thank you for your responses, app103 and Milesahead.

I tried BrowserBunch again, but it does not seem to work, so I think I might be doing something wrong. This is what I have tried: After placing BrowserBunch in the Roaming folder on my Windows 7 machine, I used the /setup key to add Chrome, Aurora and IE to the buttons. But, when I click on an URL, it continues to open up in IE, which is my default browser.

I need to keep IE as my default because of the many Intranet pages I visit every working day. However, I prefer Chrome for email and for sites which I expect to later read on a tablet . I use Aurora for a bunch of other sites.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #11 on: December 15, 2014, 05:30 AM »
Thank you for your responses, app103 and Milesahead.

I tried BrowserBunch again, but it does not seem to work, so I think I might be doing something wrong. This is what I have tried: After placing BrowserBunch in the Roaming folder on my Windows 7 machine, I used the /setup key to add Chrome, Aurora and IE to the buttons. But, when I click on an URL, it continues to open up in IE, which is my default browser.

I need to keep IE as my default because of the many Intranet pages I visit every working day. However, I prefer Chrome for email and for sites which I expect to later read on a tablet . I use Aurora for a bunch of other sites.

BrowserBunch does not intercept url launch.  You need to use the ahk script I posted.  With that script running, highlight the url then press Control Shift F4 to launch BrowserBunch, then select browser.  You may change the hotkeys but you will need to look in ahk help for the codes.  See the key names section on this page.

Browser Chooser works by making itself the default browser.  I looked into trying that for my program and found that the registry html associations were an undocumented mess.  That's why I did it the other way.  :)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #12 on: December 17, 2014, 12:53 PM »
Note that a big drawback to doing a browser utility from the "outside" rather than writing an AddOn is, in this case, selecting the text can only get that text into the clipboard.  If it is just a label for a link there's no way I know to get the actual link.

On the other hand if I wrote say, a Firefox AddOn, I don't know if I could use it to launch external programs.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Program Idea: Configurable application launcher
« Reply #13 on: December 22, 2014, 11:32 AM »
Note that if you would like to launch selected text as url arg to BrowserBunch you don't really need all that EditorGroup stuff.  This should work fine from any active window that allows you to select text.  The hotkey is Control Shift F4.

; 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
return