Posted onby admin
AppleScript to unlock your Mac's screen. (Use EventScripts to automatically trigger script when a Bluetooth device (e.g., your iPhone) enters your Mac's range:

This video will show how exactly you download and install Eventscripts, Metamod and Sourcemod and how you give youself Sourcemod Admin.Eventscripts (Link Upd. EventScripts is an application for triggering AppleScripts or shell scripts whenever certain events occur. Perhaps you would like to execute a script every time the track changes in iTunes, or whenever your internet connection drops?

EventScripts collection. Description: Provides read and write access to all event handling scripts provided for all shapes, documents and Dashboard sections with event handlers. The EventScript object has three properties: Name, Script, and Type, and no methods. EventScripts Forums; EventScripts Wiki; EventScripts PasteBin; ES Syntax Validator+. Mattie Eventscripts: 189: 0.56% L4D2 Gun Control: 189: 0.56% L4D & L4D2 Saferoom Door Spam Protection (1.1) 15-May-2020 188: 0.55%: Automatic Bot Names: 187: 0.55% TF2 Add Observer Point: 185: 0.54% CS:S/CS:GO GunGame: 185: 0.54% TF2 Be the Horsemann (9/18/2011, v1.1) 184: 0.54% Any 'SM' Prefix changer! UPDATE: March 22, 2013.

-- You need to create a Keychain item whose name matches what you use in place
-- of '[keychain_item_name]' on line #7 (and whose password is identical to your
-- user account's password).
tellapplication'System Events'
if ((getnameofevery process) contains'ScreenSaverEngine') then
setpwto (do shell script'security find-generic-password -l '[keychain_item_name]' -w')
tellapplication'ScreenSaverEngine'to quit
keystroke pw
-- set require password to wake of security preferences to false
end if
end tell

commented Apr 16, 2014

Cf. leaving_range.scpt:


commented Dec 3, 2014

I've attempted to use this in Yosemite to no avail. You don't have an updated version of this do you?

EDIT: Never mind! This actually works perfectly. Thank you for the awesome script.

commented Jul 12, 2016

If i am using apple script for this script it is not working. Any suggestions.

commented Oct 19, 2016

Tested this on macOS Sierra(10.12).


Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

NoTouch has different 'hooks' that can be used to attach custom program code at certain events. This is about advanced customization scenarios and not used in day-to-day operation. You may define your own scripts or copy/paste commands that you got from third parties or Ncomputing support. While absolutely no Linux know-how is necessary in regular NoTouch operation, this is the way to go to the Linux OS level and fully use its power. Most likely, if you install 3rd party applications on your own you will find these event scripts handy as well.


Boot-up event scripts

The boot-up event scripts are found in 'All' and then 'Event scripts'. It is so rarely used that there is no top-level link in the local configuration application, that's why you need to click on 'All' first. In NoTouch Center however, these parameters are merged into the 'Administration' tab.

The parameters are structured according to the point they are executed in the boot process:

  • Startup 0 - before hotplug service. This executed at the earlierst possible moment. Devices, neither internal nor peripherals, are yet initialized.
  • Startup 1 - before network initialization. Right before starting to initialize the network, but after initializing devices and loading drivers.
  • Startup 2 - with networking. At this point the system should be on the network and have an IP address.
  • Startup 3 - after local services. This is run when local services such as the SSH service (if activated), the NTP service (if activated), the administration tool etc are running.
  • Startup 4 - at GUI/X11 start. This command is special because it will block the NoTouch execution - it is executed during the GUI subsystem (X11 server) start.

Note - if not explicitly mentioned, commands will not block execution. That makes sure the system will boot up, but it may lead to race conditions (i.e. you believing your command should do something but in fact a NoTouch-internal routine could be faster and disturb your command).

Connection-specific event scripts

You can also define scripts or commands that are executed on connection-specific events, such as starting a connection. Please see Connection#customization hooks for more information.

Eventscripts 2.1.1 Download

X Server event scripts

To put custom code into the execution of the X server (=the low-level GUI subsystem), please see X11#Customization hooks.

Network-related event scripts

Eventscripts Download

To run custom code based on network interface up/down events, please see Interface configuration#Event scripts.