Created
April 25, 2024 18:49
-
-
Save Lorenzo501/2123c3e42b8e995ea654321d3eb4c518 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Simply go to properties of the web app icon in the taskbar for example and set these values: | |
Target: "%UserProfile%\Downloads\AutoHotkey\Open VSCode Web Editor With Recent Folder.ahk" | |
Start in: %UserProfile%\Downloads\AutoHotkey | |
*/ | |
#Requires AutoHotkey 2.0 | |
#NoTrayIcon | |
Persistent() | |
A_WinDelay := -1 | |
EVENT_OBJECT_NAMECHANGE := 0x800C | |
if (ProcessExist("chrome.exe") || !(hasTabsOutlinerExtension := DirExist(EnvGet("LocalAppData") "\Google\Chrome\User Data\Default\Extensions\eggkanocgddhmamlbiijnphhppkpkmkl"))) | |
{ | |
Run("chrome.exe --app-id=jhdpafkbedbgckdnecbbppbpboebapeb --start-maximized --disable-features=GlobalMediaControls") | |
if (WinWaitActive("Visual Studio Code - Welcome",, 15)) | |
Send("^r{Enter}") | |
ExitApp() | |
} | |
else | |
{ | |
DllCall("SetWinEventHook", | |
"UInt", EVENT_OBJECT_NAMECHANGE, | |
"UInt", EVENT_OBJECT_NAMECHANGE, | |
"Ptr", 0, | |
"Ptr", CallbackCreate(HandleTabsOutlinerEvent), | |
"UInt", 0, | |
"UInt", 0, | |
"UInt", 0) | |
Run("chrome.exe --app-id=jhdpafkbedbgckdnecbbppbpboebapeb --start-maximized --disable-features=GlobalMediaControls") | |
} | |
;********** LIBRARY ********** | |
HandleTabsOutlinerEvent(hWinEventHook, event, hWnd, *) | |
{ | |
static isBeingClosed := false | |
try | |
if (WinGetTitle(hWnd) = "_crx_eggkanocgddhmamlbiijnphhppkpkmkl" && !isBeingClosed) | |
{ | |
isBeingClosed := true | |
WinSetTransparent(0, hWnd) ; Gets rid of the close animation | |
WinClose(hWnd) | |
WinWaitActive("Visual Studio Code - Welcome",, 15) | |
Send("^r{Enter}") | |
ExitApp() | |
} | |
} |
To prevent pictograms from moving on W10 desktop when saving files in VSCode, as well as being able to see the collection of scripts; You should put unfinished scripts in the "Downloads\AutoHotkey\Experimental" folder, and then any script that you need easy-access to, you can just make a shortcut of to put on the desktop
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote this Tampermonkey script to make it even better: