Mac Newbie - Scripting! (Proximity + JackSMS)

Discussion in 'macOS' started by MaxusHastings, Sep 3, 2009.

  1. MaxusHastings macrumors member

    Joined:
    Mar 8, 2009
    #1
    Hey Everyone!

    I am a recent Mac-Switcher (a week old...) and so far i am really enjoying the switch, slowly getting my head around the different shortcuts and methodology for OSX.

    I have recently started playing around with Proximity and JackSMS to work with my iPhone and all in all it works great...except one little flaw.

    The "away" script works great, and the return one does to, however when i return it executes everything but JackSMS doesnt "unlock" the screen even though its prompted to in the script. I am new to scripting and no doubt i missed something...below is a copy of each:

    And here is the return script:

    I am no AppleScript expert so hope someone out there can either tell me if the script is at fault of JackSMS, it runs everything (including the welcome back voice prompt) however the screen stays locked...

    Any help would be most appreciated!!

    JackSMS Version: 1.0B6 (090)
    OS X Version: SnowLeopard

    Thanks!

    Maxus
     
  2. thewierdone2000 macrumors newbie

    Joined:
    Sep 30, 2008
    #2
    Hey,

    So, JackSMS actually starts ScreenSaverEngine when you tell it to lock, and tells it to quit when you return. Therefor, the code:

    Code:
    do shell script "defaults -currentHost write com.apple.screensaver askForPassword -int 0"
    tell application "ScreenSaverEngine" to quit
    is redundant and unnecessary. Additionally, it removes the screensaver settings that you might have had before enabling JackSMS (which JackSMS restores upon you telling it to "unlock")

    The real problem in this is that SnowLeopard breaks JackSMS. If you had a Leopard machine, your script would work fine. The problem lies in the following (about to get a little technical, but follow along if you want)

    JackSMS modifies the values in the com.apple.screensaver to ask for password and do it immediately after the screensaver comes on. (Rather than giving you a 60 second grace period or something) After that, it uses a port to tell a background application (called loginwindow) in OSX to reload the screensaver settings. It then starts the screensaver.

    During the unlock command, it sets the settings to not ask for a password, tells login window to re-read it, and then shuts down the screensaver. On leopard, the end result would be that screensaver would quit, and not needing a password, would return you to the desktop. Under SnowLeopard, however, you just get a black screen and no way to authenticate back in.

    I am writing a program that borrows a lot of ideas from JackSMS and Proximity and integrates them nicely without much knowledge needed for AppleScripting from the user.

    Currently, however, I am stuck at this point as well. Snow leopard broke the way JackSMS and my program did it, so now it's tough to tell where to go now.
     
  3. MaxusHastings thread starter macrumors member

    Joined:
    Mar 8, 2009
    #3
    Hey thewierdone2000!

    Thanks for the reply, despite being a n00b on all this i think i follow it all!

    Any ideas how you could work around it all? If you are working on a little something that does it all already i would be -really- interested in grabbing a copy at somepoint : )

    Cheers,

    Maxus
     
  4. thewierdone2000 macrumors newbie

    Joined:
    Sep 30, 2008
    #4
    Right now the only solution jumping to my mind is running the screensaver within the program, and doing my own login window. Problem with that is that it probably gets foiled by cmd-opt-escape... so a lot of security that offers eh?

    Frankly, if anyone had any ideas on something to try, I'd be more than game to try and whip something up.

    There is also a possible hope that this is a bug, and not a feature of snow leopard in which case... fingers crossed for 10.6.1 ;-)
     

Share This Page