Yes, you can:)
1) First of all, you need Arduino to βlistenβ to the sensor. This can be achieved using the digitalRead or analogRead methods, depending on the type of sensor you intend to use.
2) You need to send something to your Mac when the condition you want to check happens. This involves using the Serial Port to send any message from Arduino to your mac.
3) On your Mac, you need to check the messages on the serial port. I often use Processing to listen on the serial port. You are lucky, you are on a mac, you have AppleScript :) This means that for processing you will need to run a simple Applescript that will show your selected application opening
What is it. For more information check google to find out how to send messages from arduino to processing, and how to run Applescript through Processing
source share