AMApplicationBuild 527 AMApplicationVersion 2.10 AMDocumentVersion 2 actions action AMAccepts Container List Optional Types com.apple.applescript.object AMActionVersion 1.0.2 AMApplication Automator AMParameterProperties source AMProvides Container List Types com.apple.applescript.object ActionBundlePath /System/Library/Automator/Run AppleScript.action ActionName Run AppleScript ActionParameters source tell application "Terminal" -- Check if there are any open windows if (count of windows) is greater than 0 then -- Get the position of the first window set windowPos to position of window 1 -- Use the first window if it's open set existingWindow to window 1 do script "~/thesis/code/scan.sh 2 ; sleep 2; ~/thesis/code/publish.sh; exit" in existingWindow else -- If no windows are open, create a new window and set its position to the last window's position set windowPos to {200, 200} -- Default position if no window was open previously do script "~/thesis/code/scan.sh 2; sleep 2; ~/thesis/code/publish.sh; exit" set position of the front window to windowPos end if activate end tell delay 3 -- Wait for the scripts to finish executing tell application "Terminal" -- Close all Terminal windows set terminalWindows to every window repeat with aWindow in terminalWindows if busy of aWindow is false then close aWindow end if end repeat end tell BundleIdentifier com.apple.Automator.RunScript CFBundleVersion 1.0.2 CanShowSelectedItemsWhenRun CanShowWhenRun Category AMCategoryUtilities Class Name RunScriptAction InputUUID 8C226B47-458F-4409-BF3A-8ABE247C1FF2 Keywords Run OutputUUID F5590A01-ECCB-4790-974A-DA4BC1310717 UUID 45370EDA-E9D5-465E-B975-C2D83FE6A8D4 UnlocalizedApplications Automator arguments 0 default value on run {input, parameters} (* Your script goes here *) return input end run name source required 0 type 0 uuid 0 isViewVisible 1 location 631.500000:315.000000 nibPath /System/Library/Automator/Run AppleScript.action/Contents/Resources/Base.lproj/main.nib isViewVisible 1 connectors workflowMetaData workflowTypeIdentifier com.apple.Automator.application