How to open Core shell in background using AppleScript

Hi Yang,

Please let me know how can run commands in AppleScript and open Core shell in background (invisible mode) Or if can run commands in apple script and core shell is minimized.

Thanks

Happy birthday, Jose.

Sorry for late reply. I'm not an AppleScript expert, here is my two cents, you can move Core Shell to background using "System Events", first activate it, then hide it explicitly:

tell application "Core Shell"
	-- Do some stuff
	-- ...
	-- ...
end tell

tell application "Core Shell" to activate
tell application "System Events"
	-- wait until your application comes forward and then hide it
	repeat
		set p to first process whose frontmost is true
		if name of p is "Core Shell" then
			set visible of p to false -- hide your application
			exit repeat
		end if
		delay 0.2
	end repeat
end tell
1 Like