How to open a file in multiple programs as my 'default program' - windows

So I've got a lot of manual HTML checking to do, most of which is just a quick glance at the code and then make sure the page displays correctly.
My thought is that it would be much easier to do this if I could set multiple programs to open when I double click on a .htm file. By this I mean open the file in the programs I specify all at once without multiple "right-click > open with > the program" actions.
So really I'd like for it to open in my HTML editor, Chrome, and Firefox all at once and then I can just glance at them all and move about my business. I figure I'll still have to close all of them manually but at least I can do that every once in a while not EVERY time.
Any ideas? I was thinking about a simple man-in-the middle app to open all of the programs, but that seems like it would be a rather large solution to a small issue, is there a simple (and fairly quick-to-execute) way of doing this in a windows-based fashion, or should I just try and slim down this proposed app as much as possible and maybe it won't be too slow to open?

I was thinking about a simple man-in-the middle app to open all of the programs
That is exactly what you need. And then you can add that app to the "Open With" menu of the file extension(s) you want to process.
that seems like it would be a rather large solution to a small issue
Not really. It would actually be a very small app to implement. All you need is a configuration to specify the target apps, then receive the selected filename(s) as command-line parameters and pass them in a loop to the other apps using ShellExecute/Ex() or CreateProcess()as needed. Not much to it.
is there a simple (and fairly quick-to-execute) way of doing this in a windows-based fashion
Not really. You have to create your own app for it, and then register it so you can invoke it when needed.
should I just try and slim down this proposed app as much as possible and maybe it won't be too slow to open?
It won't be slow at all, unless you make it slow. If you really want to cut down overhead, you could even implement it as a simple .bat script that uses the start command to launch the files, instead of compiling an actual executable.

Looks like you would create something called a Shortcut Menu Handler. Beware, as that involves messing with the registry.

Related

Handle GUI window changes

I'm doing an automation script for installation wizards using AutoIt. I'm trying to handle window changes in some way.
Can some one explain how these GUI's work?
When I click on the Next button it looks just like the components in the GUI is beeing changed. Is this tha case? Or is a new window created and the old destroyed?
I've noticed that the process ID is the same for all windows.
I'm sure there is some way to know which "state" the GUI is in, or which step?
By the way. All the windows has the same title.
Thanks
/Anders
This will be dependant on the program you are automating.
The easiest approach would be to look at what changes in the GUI between stages, likely candidates are if there is a label that is giving instructions for that step, or a button that has text changing (e.g. if the button says "Finish" then you know your at the end).
Most installer programs have child windows for grouping the controls of each stage. These are typically implemented as dialog resources (as can be seen when using something like reshacker on them). So although the window remains the same, the panels are being created/destroyed as appropriate. This is a very neat method of doing it, for the obvious reason that you don't need to have to code to create/destroy a lot of controls. Resource created dialogs don't have nice class names like windows sometimes do though, so this may not be a reliable way to check the state.

Open an application in a space using applescripts

I am trying to create a script that will open an application in a specific "space". So let's say I am on space 1 working in the terminal and then I want to be able to open safari in space 4. Is there a way to do this?
I have done some searching and found only ways to set the system profile options. Maybe I should tell you my end goal in case what I am attempting is not possible.
I use a laptop and plugin in to multiple stations, home, office, and travel. I want to create different window layouts for each one. So I will need an apple script telling it to open applications in varios spaces and different dimensions. I hope this makes sense. Ask me for clarification if it doesn't thanks!
PS the answer doesn't necessarily have to be any applescript I just thought that would be the easiest way :)
Here's a list of applescript commands for Spaces. There's a couple things there that might help you.
It is possible to do some scripting of application Space preferences by using the scripting interface to the System Events.app. See the answer to a similar question here.
The easiest way I've found is via GUI scripting. Make sure the Spaces menu is active on the upper right of your computer. That lists the spaces by number. You can then just write a GUI script to select the menu item of the space you wish. That will switch to that space. Then do an activate Applescript to open the application there.
Let me know if you need sample code demonstrating this. I have some in Python + Appsscript that does this but I should be easily able to convert it back to Applescript proper if you need it.

Taking notes to a background text editor without switching windows

I am looking for a solution to a specific use case:
When I read something on my browser or pdf reader, I want to take notes without switching windows. I want to type right on my browser or pdf reader, but the typed text should go to the background text editor like notepad.
Is this possible?
Do you know any existing automation script that handles this use case?
You should create an application that uses some keylogger-like techniques (e.g. global hooks) to monitor the keypresses and, depending on some condition (a setting you may have set, the currenctly active window, ...), it may pass them normally to the application or suppress them to store them in a buffer. Such buffer, then, would be shown to the user as needed.
Still, in my opinion a much more convenient way to perform a similar task would be to create an application consisting of a semitransparent edit box, that could be shown and hide simply with a hotkey. This would avoid all the hooks stuff and the potential problems that may arise from them.
you might try using autohotkey scripting language... I can write a little script that would do exactly what you need and afaik in this particular case it wouldnt need keyboard hooks.
--EDIT--
Autohotkey is VERY simple to use/learn so even if you want to do the script yourself you can do it in a very short time even if you dont have any knowledge of ahk. Then again, I can help you with it.

Creating quick GUI front ends

I wanted to have a GUI front-end for a script that accepts numerous command-line options, most of them are UNIX paths. So I thought rather than typing them in (even with auto-completion) every time, I'd create a GUI front end which contains text boxes with buttons beside them, which when clicked will invoke the file browser dialogue. Later, I thought I'd extend this to other scripts which would sure require a different set of GUI elements. This made me think if there's any existing app that would let me create a GUI dialog, after parsing some kind of description of the items that I want that window should contain.
I know of programs like Zenity, but I think it's doesn't give me what I want. For example, if I were to use it for the first script, it'll end up flashing sequence of windows in succession rather than getting everything done from a single window.
So, basically I'm looking at some corss-platform program that lets me create a window from a text description, probably XML or the like. Please suggest.
Thanks
Jeenu
Mozilla's XUL is a cross platform application framework - . You could write an app as a Firefox plugin or a standalone XUL application.
mono and monodevelop could work for this. Or even something super simple like shoes.

Is there a simple way to change the text of the 'Open' button on the windows file dialog to 'Select'?

We're using the file picker dialog to allow users to add documents into our application. The word 'Open' doesn't make a lot of sense in this case.
Thanks.
I would browse the code found here, which shows how someone extended the OpenFileDialog. Admittedly, this is overkill for you. But I think there is code within to change the button label.
Not really no.
Given the standardization of this dialog it's extremely likely that your users will have used it many times in the past to "add" files to applications. The chances are they will be quite familiar with the implications of the word, changing it may be more confusing to them.
The standardness of the dialog is why it's called a "Common File Dialog". If you want to change it for your app, you'll have to write your own dialog.
Having said that, there are apps out there that can pull a form out of a DLL, modify it, and stick it back in. However, this is a per-machine hack and downright bad form.

Resources