I have a script in msword which can print the current page when clicked on button created in toolbar, and also a keyboard shortcut ctrl+o to print.
The ahk script code which contains ctrl+0 shortcut works just fine. But I have to open manually word documents each time to do that, and I have hundreds documents to print every day.
I wanted to add a script or keyboard shortcut using ahk in right click context menu in windows, so that when I right click on my word files in folder it can do the same without opening the word files.
I tried adding the ahk script in regedit...HKEY_CLASSES_ROOT*\shellex\ContextMenuHandlers. But it gives me an error : This app can't run on your pc.
Any idea how can i do that ?
Related
when I press ctrl + tab it doesn't move the file right away but rather shows a list of all open files
I need the default behavior where it takes me right away to the last opened file without having to press enter
PS: if this helps in any way I'm using Linux Mint (LMDE 4 (debbie) x86_64)
You don't have to press Enter, just release the Ctrl key. That will take you to the last file you were in.
For instance, if you're in FileA and you have FileB and FileC open and you were last in FileC, Ctrl+Tab shows the list, and when you release Ctrl, you're taken to FileC. Do it again (releasing Ctrl) and you'll be back in FileA.
Check your keyboard shortcuts. Find the command:
workbench.action.quickOpenNavigateNextInEditorPicker
By default it is set to Ctrl-Tab, if yours is not, set it that keybinding by clicking on the pencil icon to the left of the command on hover and enter Ctrl-Tab into the dialog box.
That command should also be using the when clauses: inEditorsPicker && inQuickOpen
Sometimes when closing vscode, or a tab therein, I get a dialogue asking "Do you want to save the changes you made to filename?" However, the unsaved edits are actually from a previous session that was closed without such a query, probably when turning off the computer, so I can't remember if it was meaningful edits, or maybe just an accidental key-press, like a shortcut gone wrong; and doing undo to revisit the last edits doesn't work either.
My question: How can I see the diff between the saved version of a file, and the version in the editor window? I think it would be nicest just to have a "show diff" option in the dialogue, but for now I'm also happy with a command line diff command.
I'm using ubuntu 20.04.
I'm using VSCode version 1.52.1 on MacOS and I had a similar problem that may not be the same problem, but I'm guessing it will work for you as well.
When you're in the Explorer view, in the upper left part of Explorer you have your "Open Editors." If that shows a dot to the left indicating that the buffer has changes in it, you can right click the file name and select "Compare with Saved." This will open another buffer to the side that will show you any unsaved changes.
To get rid of that window (it took me a bit to figure this out I'm sorry to say!), you can click the 'X' to the left of the extra buffer in "Open Editors."
Hope this works for you!
A few bright notes for the keyboard players out there:
The command you are asking about has a default shortcut. Unless you've applied a keyboard map extension, the Ctrl+Kd arpeggio opens the very same diff view between the active and saved versions of the current file. The default shortcut to close an editor tab (be it the diff or a file or anything at all) is Ctrl+W.
The command, like any command in VSCode, is also accessible via the Ctrl+Shift+P command dropdown (on Linux, F1 opens it too). Start typing e.g. compa sav (it saves your keyboard wear and tear to shorten words to a prefix which is unambiguous enough), and the list will shrink dynamically to just a few commands. Yours is File: Compare Active File with Saved. When it's close to the top enough, navigate the list of commands with the down arrow and execute it with Enter. As a bonus, you may click on the little gear to the right of the command currently highlighted in the list and redefine its shortcut, if you use it very often and prefer a chord shortcut to the default arpeggio one. Sorry, there does not seem to be a shortcut in lieu of the gear click. If there is, please let me know!
But if you really, really want to right-click on the filename in the Open Editors view of the Explorer sidebar, you can open that view directly with, you guessed it, a shortcut: Ctrl+Ke. And if you change your mind on a dime right at this moment, or realize that you in fact never had a mouse to do the right-click in the first place, use Shift+F10 to drop down the "right-click menu", properly called the context menu, which you navigate with arrows and execute with Enter (that's kinda a common theme, as you probably noticed). This works mostly anywhere the right-click does.
While in the Open Editors view, to switch to an editor file tab, move the selection to the desired file. Press Space to bring the file into view but stay in the Open Editors view, or Enter to bring the file into view and shift the keyboard focus to it. Pressing Ctrl+Shift+E brings focus back to the editor from any view in the Explorer sidebar. The same shortcut moves focus to the Explorer sidebar from the editor.
Happy ♬ k'boarding ♬!
ctrl+shift+P (or command+shift+P on mac) and fuzzy search for "compare changes with saved files"
I swear something has changed with VS code. You used to be able to click on a file in the file explorer, and it would automatically focus on the body of the file, so you can start typing immediately. Now, (1.36.1), when you click on a file in the file explorer, it stays focused on the file explorer, so if you start typing after clicking, it will start a search inside the explorer instead of the editor. This is extremely user hostile and I really want it disabled, it's totally throwing off my flow. How can I disable this?
When I press Command+Shift+E (Mac) to set focus to the explorer in Visual Studio Code, I can navigate using the up and down keys to select a file, but I can't open the file in the editor. I can press Enter to rename it, but I couldn't find a way to open the file using the keyboard. Is there a way?
Correct shortcut to open a file is: CMD+down
Just for the record, this is the standard shortcut in any properly behaving OSX application, for example Finder.app (and it's the reason why Return/Enter renames a file)
I want to have a script that works with a specific program open when I open that program with the program's shortcut icon. I have tried pasting the path into the target line in the icon's properties, but that didn't work. What do I need to do?
I think that I read that you want to create an icon that looks like the original application launch icon, which will, when clicked, indeed launch the original application AND run some extra ahk code. You can create a Shortcut or Link to a ahk script that will launch your app (run, c:\path\yourapp.exe) and perform other tasks (WinWaitActive, your app) etc.. In the link to the ahk script (does not work on the real ahk script, ONLY with the lnk file) you can select the properties (right click) and change the icon to whatever you want (often you can use the icon of the original application, by pointing to the .exe (instead of selecting icons from the the standard shell32.dll). So by selecting the new icon to e.g. c:/program files/officexx/word.exe , your AHK script will get the icon as if it is the word launch icon. Hope that answers your question.
At the beginning of the script, but ater you execute the run command, you place the timer
Run, abc.exe
SetTitleMatchMode, 2
Sleep, 1000 ; Give the app some time to run before you start the test
SetTimer, CloseScript, 1000
Return
CloseScript:
IfWinExist, place the windows title here....
Return
ExitApp
This is one of the first things that I did with AutoHotKey. I wanted a 'wrapper' script for a program that I regularly used that lets me to chose different program options with a script GUI form when I press the F4 key while clicking the link. Just clicking the link starts the program normally. Eat your heart out Microsoft.
In the link's Start-In property I put the actual program's directory and my script gets the program name and other details from the script's command line arguments in the link's target property.