- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2
switchTo Functions
A list of switchTo Functions complete with definitions.
All switchTo functions are contained within a class called switchTo and are called like: switchTo.X()
The idea behind these functions was initially showcased by Taran a previous editor for LTT.
Their main purpose is to;
- If an instance of the desired program doesn't exist, open it
- If an instance of the desired program DOES exist, activate it
- If multiple instances of the desired program exists, cycle between them based off the last active
A list of switchTo. scripts based off this premise includes;
- 
switchTo.Explorer()- Includes parameter toggleFullscreen := false; To determine whether you wish for the explorer window to be toggled fullscreen and then back to normal when running a new explorer instance. There are reports that doing this improves explorer responsiveness.
 
- Includes parameter 
- switchTo.Premiere()
- 
switchTo.AE()- 
switchTo.Premiere()&switchTo.AE()will require the user to properly generate (or manually create) shortcuts that link the the.exefor both programs and place them in..\Support Files\shortcuts\. This can also be achieved by opening the individual settings menu withinsettings()and either adjusting theYeardrop down or by toggling the beta checkbox
 
- 
- 
switchTo.Disc()- I have this function move my discord window to a specific position if it's not already. Check that position at the top of the script
 
- switchTo.Photoshop()
- switchTo.Firefox()
- 
switchTo.OtherFirefoxWindow()- I use this in other functions for various reasons
 
- switchTo.Chrome()
- switchTo.VSCode()
- switchTo.Streamdeck()
- switchTo.Excel()
- switchTo.Word()
- switchTo.WindowSpy()
- switchTo.Edge()
- switchTo.Music()
- switchTo.Slack()
- switchTo.ahkDocs()
This function when called will close all windows of the desired program EXCEPT the active one. Helpful when you accidentally have way too many windows open.
switchTo.closeOtherWindow( [program {, ttip := true}] )Type: String - Program Information
Either
ahk_exe program.exeor aahk_class xof the desired program.
Type: Boolean
Determine whether the user wishes for the function to present a tooltip upon completion that displays how many windows were closed.
This function is specifically designed for my secondary keyboard and works in tandom with the switchTo() functions.
If the desired program isn't already open, it will run a first instance, if the desired program is already open, it will run a second instance without disrupting the first.
switchTo.newWin( [classorexe, activate, runval] )Type: String
This parameter is just defining whether the function is trying to grab the
ahk_classor theahk_exevalue of the desired program.
Type: String
This parameter is whatever usually comes after the
ahk_classor theahk_exevalue of the desired program.
Type: String - Filepath
This parameter is whatever you would normally need to feed into a
Run()command to open the desired program. Either a full file path, or something along the lines ofexplorer.exe,firefox.exe, etc.
This function opens the current Premiere Pro/After Effects project filepath in windows explorer.
If prem/ae isn't open it will attempt to open the
ptf.commsfolder.
switchTo.adobeProject( [{optionalPath := "", switchCurrentWindow := true}])Type: String
This parameter allows the user to navigate to a directory beyond (or before) where the project file is located. See example #1 for more.
Type: Boolean
Determines whether to change the current active window to the desired path, or whether to always open a new window
Type: Boolean
returns
true/falsewhether the function succeeded or failed
Example #1
;// will open the folder before where the project file is located
switchTo.adobeProject("..\")
;// will open the `videos` folder in the same dir as the project folder (if it exists)
switchTo.adobeProject("\videos")A function to nagivate the desired explorer window to the desired path
switchTo.Path( [FullPath {, hwnd := ""}])Type: String
The full path you wish to navigate to
Type: String/Boolean
The hwnd of the window you wish to operate on. Defaults to the active window
Activates/runs the desired directory & focuses the desired file.
switchTo.explorerHighlightFile( [filepath])Type: String
The full filepath of the desired file/directory you wish to open and select
Type: Boolean
Keeping Track
Keyboard Shortcut Adjustments
libs & Classes
Editors
Apps
Other lib files
Hotkeys
Timer Scripts
- adobe fullscreen check.ahk
- Alt_menu_acceleration_DISABLER.ahk
- autodismiss error.ahk
- autosave.ahk
- gameCheck.ahk
- Multi-Instance Close
Other Scripts
- Hotkey Replacer.ahk
- checklist.ahk
- Streamdeck AHK
- CreateSymLink.ahk
- adobeKSA.ahk
- ExplorerDialogPathSelector.ahk
Other Guides