#SingleInstance force GetProofLabSrcDir(ByRef attemptedPaths) { attemptedPaths := "" EnvGet, envCoreRoot, PROOFLAB_CORE_ROOT if (envCoreRoot != "") { envSrc := RTrim(envCoreRoot, "\/") . "\src" attemptedPaths .= envSrc . "`n" if FileExist(envSrc . "\ProofLabLauncher.jsx") return envSrc } localSrc := A_LocalAppData . "\ProofLab\core\src" attemptedPaths .= localSrc . "`n" if FileExist(localSrc . "\ProofLabLauncher.jsx") return localSrc scriptDirSrc := A_ScriptDir . "\src" attemptedPaths .= scriptDirSrc . "`n" if FileExist(scriptDirSrc . "\ProofLabLauncher.jsx") return scriptDirSrc return scriptDirSrc } RunIllustratorScript(scriptName) { srcDir := GetProofLabSrcDir(attemptedPaths) scriptPath := srcDir . "\" . scriptName if !FileExist(scriptPath) { MsgBox, 16, Proof Lab Error, Script file not found:`n%scriptPath%`n`nChecked paths:`n%attemptedPaths%`nRun start-pdb-bridge.cmd once to refresh local runtime. return } RunWait, powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Unblock-File -Path '%scriptPath%' -ErrorAction SilentlyContinue", , Hide Run, Illustrator.exe "%scriptPath%" } #n:: if WinActive("ahk_class illustrator") { RunIllustratorScript("LaboratoryLauncher.jsx") } return #0:: if WinActive("ahk_class illustrator") { RunIllustratorScript("SwatchesSettingsLauncher.jsx") } return ^!s:: if WinActive("ahk_class illustrator") { RunIllustratorScript("SetupVariablesLauncher.jsx") } return ^!p:: if WinActive("ahk_class illustrator") { RunIllustratorScript("PickerLauncher.jsx") } return ^!g:: if WinActive("ahk_class illustrator") { RunIllustratorScript("PlaceGarmentLauncher.jsx") } return #+p:: if WinActive("ahk_class illustrator") { RunIllustratorScript("ProofLabPanelLauncher.jsx") } return