Auto-Install Software

Give this a go, @noisneil. Long-form and arrow-headed for readability.

It seems the trick is to select the row containing the checkbox before you click the checkbox...

tell application "System Events"
	tell application process "Installer"
		tell window 1
			tell group 1
				tell splitter group 1
					tell group 1
						tell scroll area 1
							tell outline 1
								repeat with eachRow in (get every row)
									set cbName to name of checkbox 1 of eachRow
									if cbName contains "AAX" or cbName contains "VST" then
										select eachRow
										tell checkbox 1 of eachRow
											click
										end tell
									end if
								end repeat
							end tell
						end tell
					end tell
				end tell
			end tell
		end tell
	end tell
end tell

You can see the "default" install choices with (assuming the Fuse installer .pkg is on your Desktop)

installer -showChoicesXML -pkg ~/Desktop/Fuse\ Audio\ Labs\ VCL-4.pkg -target LocalSystem

You can then create a "choice changes file" -- an XML file that the installer merges with the original to create an install solution it can then run.

That's as much of the theory as I know -- and I have never done this in practice! I'll dig further if the AS above isn't working, coz it's something I should learn about anyway...

More info available via the Terminal with man installer if you're interested.

2 Likes

You've only gone and nailed it! Thankyou so much!!! The only way it could be improved is if the list of strings to check for could be set as a KM variable and then iterated in the AS.

But that's just me being greedy.

Greed is good! :wink:

Set the first action, one search term per line:

Installer Setter.kmmacros (2.6 KB)

Image

AS code, in case text wrapping hides the changes
set inst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
	set searchStrings to getvariable "Local_theSearchStrings" instance inst
end tell

tell application "System Events"
	tell application process "Installer"
		tell window 1
			--activate
			tell group 1
				tell splitter group 1
					tell group 1
						tell scroll area 1
							tell outline 1
								repeat with eachRow in (get every row)
									set cbName to name of checkbox 1 of eachRow
									repeat with eachItem in (every paragraph of searchStrings)
										if cbName contains eachItem then
											select eachRow
											tell checkbox 1 of eachRow
												click
											end tell
											exit repeat
										end if
									end repeat
								end repeat
							end tell
						end tell
					end tell
				end tell
			end tell
		end tell
	end tell
end tell
1 Like

No.

The list of lists is the point and for demonstration.

You're code returns a list of lists – yes?

Play with the code – step through it in Script Debugger and see how it works...

1 Like

Amazing! Couldn't be happier with it and I've learned loads! Thanks everyone.

Here's the finished thing:

Auto-Install Plugins.kmmacros (60 KB)

Macro screenshot

Usage: Select one or more installers in the Finder and trigger this macro.

4 Likes