Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 11, 2013, 08:00 PM   #1
Pecans
macrumors member
 
Join Date: Jul 2012
Applescript help

I am a new to programming applescripts. The one I am trying to get to work now is supposed to quit my screensaver and enter my password but I can't get it to work no matter what I try. Here's the code.


Code:
on run
	tell application "ScreenSaverEngine" to quit
	tell application "System Events" to keystroke 1 (this is to pull up the textfield for the password)
	delay 1
	tell application "System Events" to keystroke "MyPassword"
	delay 1
	tell application "System Events" to keystroke return
end run
Anyone have any ideas how to get this to work?

Last edited by OllyW; Jan 12, 2013 at 12:17 PM. Reason: Please use code tags
Pecans is offline   0 Reply With Quote
Old Feb 10, 2013, 07:00 PM   #2
numero
macrumors member
 
Join Date: Jul 2002
Location: OR
This works for me with one addition for my testing. I added a "delay 20" line right after the "on run". I setup my screen saver to require password password (under Security pref pane) and setup a hot corner for screen saver. I ran the script from the script editor and put my mouse in the hot corner. The 20 second delay gave me time to get the screen saver running. After the 20 seconds the password dialog shows up, the text is typed into it and the enter key is accepted. Screen saver is dismissed as expected.

How are you launching the script? Maybe it isn't getting triggered.
numero is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Why so much Applescript? Dranix Mac Programming 25 May 2, 2014 01:05 AM
help with applescript andrewisgod Mac Programming 0 Apr 18, 2014 07:58 AM
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Programming 0 Oct 28, 2013 11:38 PM
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Applications and Mac App Store 0 Oct 28, 2013 11:32 PM
Help with an Applescript Theydonboi Mac Applications and Mac App Store 2 Nov 5, 2012 11:52 AM

Forum Jump

All times are GMT -5. The time now is 09:27 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC