All of those are doable with appleScript.
- Create a simple GUI for the user to make some selections and to show progress as script runs.
I would use DialogToolkit Plus for the user selection, and AppleScript has a built in progress bar display.
- Verify that certain software is installed and get the version number of each.
This can be done using this handler:
on GetApps(appNames)
set infoForApps to {}
tell application "System Events" to set allProcesses to processes whose background only is false
repeat with thisProcess in allProcesses
tell application "System Events"
tell thisProcess
properties
set appBundleID to bundle identifier
-- set appFile to path of application file
set appScriptable to has scripting terminology
end tell
end tell
set {fullAppName, appVer, appBundleVer} to GetappsInfo(appBundleID)
if fullAppName is in appNames then
set the end of infoForApps to {¬
fullAppName, ¬
appVer, ¬
appBundleVer, ¬
appBundleID, ¬
appScriptable ¬
}
end if
end repeat
return infoForApps
end GetApps
- Create a .csv file and write to it.
Very simple to do using basic plain vanilla appleScript. It becomes more complex if the data is not already in csv format.
- Lock out keyboard and mouse until script is complete (enabled Esc key to quit script in case user wants to quit script early)
No, I don’t think there’s an easy way to do this on a mac.
- Get computer name, OS edition and version/build number
Computer name is available from System events. Here’s commands to get OS version/build number.
set sysVer to (current application's NSProcessInfo's processInfo()'s operatingSystemVersionString()) as text
set sysVer to text items of (sysVer as text)
set {sysVer, buildNum} to ({item 2 of sysVer, item 4 of sysVer})
set sysVer to {"--> Mac OS Version " & sysVer & " (" & buildNum & ")" as text}
- Launch an app (Excel, Power BI, Visual Studio, HWInfo or something similar)
Yes, use the appleScript
tell application "app name" to activate/launch
or
tell application "Finder" to open "path to application"
- Either send direct commands to the app to perform a function (Rebuild a solution, export a report, run a macro, etc.)
Yes, that is what AppleScript does.
- OR manipulate the GUI to perform those same functions if there isn’t a direct command.
Yes, that’s also what AppleScript does.
- Get the time (to the tenth of a second) when a function/action is initiated.
This gets you the date and time to the second.
set staretTime to current date
I know there are ways to get more precision via AppleScript, but I’ve never needed that and so I can’t help you there.
- Wait for the function/action to complete (in most cases I had to check the pixels on the screen and wait for them to stop changing) but some of the direct commands I was able to use with Excel for example would pause the script until they completed.
In most cases that’s the default procedure. Your script sends an apple event to an application, then waits for a response.
- Get the time when the function/action completed and calculate the difference. I ultimately want to output the times as hh:mm:ss:. AutoIT gave me the times in milliseconds and I had to convert that to the format above.
set startTime to current date
--your script goes here
set endTime to current date
set endTime to startTime + (20 * hours) + (10 * minutes) + 30 -- you may use this command to test
set elapsedTimeInSeconds to endTime - startTime
set theMinutes to elapsedTimeInSeconds div 60
set theHours to elapsedTimeInSeconds div hours
set theSeconds to elapsedTimeInSeconds - (theMinutes * 60)
set theMinutes to theMinutes - (theHours * 60)
set AppleScript's text item delimiters to {":"}
return {theHours, theMinutes, theSeconds} as text
Note, the format here is “h:m:s” for single digit numbers, and would require a tiny be of formatting for “hh:mm:ss”