Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Lock/unlock screen using AppleScript and Salling Clicker' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Lock/unlock screen using AppleScript and Salling Clicker
Authored by: GVesterg on May 10, '09 06:50:33AM
The Salling AppleScript unlock script didn't work for me, so I rewrote it. You may want to change the delay statements to delay values that suit you better:
property mypassword : "Some Password"
property MypasswordLc : "some password" -- Same password in lower case
property casestring : "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

using terms from application "SEC Helper"
  on process entering proximity a_terminal
    tell application "System Events"
      set the process_flag to (exists process "ScreenSaverEngine")
    end tell
    if the process_flag then
      delay 15
      tell application "SEC Helper"
        simulate keyboard charcode (ASCII number return)
        delay 12
        considering case
          repeat with i from 1 to count mypassword
            if (item i of mypassword is in casestring) then
              simulate keyboard modifiers {"shift"} charcode (ASCII number (item i of MypasswordLc))
            else
              simulate keyboard charcode (ASCII number (item i of MypasswordLc))
            end if
          end repeat
        end considering
        simulate keyboard charcode (ASCII number return)
      end tell
    else
      return
    end if
  end process entering proximity
end using terms from


[ Reply to This | # ]