Move Downloaded App to Applications Folder and Open It


Can anyone help with a macro to move an app, selected in Finder, to /Applications and then opening it (preferably it should do a 'right-click open' as to bypass Gatekeeper)?


1 Like

Hey Martin,

That’s not too difficult. Try this in an Execute AppleScript Action:

set appFolder to path to applications folder from system domain
tell application "Finder" to set finderSel to selection as alias list

if length of finderSel = 1 then
	set appPath to POSIX path of item 1 of finderSel
	set shCMD to text 2 thru -1 of "
		xattr -d " & quoted form of appPath & " ; exit 0"
	do shell script shCMD
end if

tell application "Finder"
	move finderSel to appFolder
	open finderSel
end tell


1 Like

When I run your AppleScript from a KM macro nothing happens. When I run it from Script Editor I get this:
error “xattr: /Users/Carl/Desktop/Alarm No such xattr:” number 1


Hey Carl,

Try the edited version (same post).


Great! Thanks Chris.


Thanks a lot Chris, it works perfectly :smile: