Author: Sander
Script Version: 3
Minimum CoyoteMIDI Build: 563
// If the "Focus if Running" parameter has a value, and that process is indeed running, focus that process and stop.
if ($parameters focus) != "" && (isprocessrunning ($parameters focus))
setfocusedprocess ($parameters focus)
return
// Check if the specified file to launch exists or is a URL.
$path = ($parameters path)
if $path == ""
messagebox "No file to run was specified!"
return
if !(fileexists $path) && !(startswith "http" $path)
messagebox "The specified file did not exist or was not a valid URL."
return
$args = ($parameters args)
// launch the app.
startprocess $path $args
// Add the parameter input fields for the translation UI.
event uirefreshed
translationparameter path (textbox "App Path" "The full path to the file of the app to launch, or the URL of the website to open." "" 0.6)
translationparameter args (textbox "Startup Args" "The startup arg to launch the app with, if any." "" 0.45)
translationparameter focus (textbox "Focus If Running" "The name of the process to bring to the foreground if it was already running. If left blank, the script will always launch the app." "" 0.45)
53 downloads