Moving from Mac to PC there was a Mac shortcut I want to replicate:
When a File Explorer window is open I’d like a keyboard shortcut to get to the desktop.
I have got close by setting up a command in Features/Commands but it opens a new File Explorer window on top of the “Open” File Explorer window (with the Desktop) but not just WITHIN the “Open” file Explorer window.
When I click back the “Open” File Explorer window changes to desktop, so I know I’m moving in the right direction.
Hope someone can help - after so many years on a Mac it’s become a weird essential for my workflow
I know this topic is old, but if you’re still looking for a way to accomplish this, you might consider AutoHotkey.
Download + install AutoHotkey v2. This script is written for v2. The one in the link below is for v1 if you prefer that.
Open “AutoHotkey Dash” from the Start Menu
Create a new script
Paste this code snippet into the document
Double-click the created script to start it
If you want it to run at start up:
a. Press WIN+R
b. Type shell:startup
c. Create a shortcut to the script file by right-clicking the script and selecting “Create shortcut”
d. Move the shortcut into the start up folder.
#Requires AutoHotkey v2.0
#SingleInstance ; https://www.autohotkey.com/docs/v2/lib/_SingleInstance.htm
#WinActivateForce ; https://www.autohotkey.com/docs/v2/lib/_WinActivateForce.htm
#HotIf WinActive("ahk_class CabinetWClass") ; explorer
^+d:: ; Set to CTRL+SHIFT+D, but you can change it to another shortcut
{
for window in ComObject("Shell.Application").Windows
try Fullpath := A_Desktop
if FileExist(Fullpath)
NavRun(Fullpath)
return
}
#HotIf
; http://msdn.microsoft.com/en-us/library/bb774094
GetActiveExplorer() {
static objShell := ComObject("Shell.Application")
WinHWND := WinActive("A") ; Active window
for Item in objShell.Windows
if (Item.HWND = WinHWND)
return Item ; Return active window object
return -1 ; No explorer windows match active window
}
NavRun(Path) {
if (-1 != objIE := GetActiveExplorer())
objIE.Navigate(Path)
else
Run(Path)
}