Auto Set ScreenSaver From Network - Simple, Right?

Discussion in 'iMac' started by mainstay, Sep 8, 2014.

  1. mainstay macrumors 6502

    mainstay

    Joined:
    Feb 14, 2011
    Location:
    BC
    #1
    We keep our photo's on a NAS, which powers down each night and powers on each morning.

    In System Preferences >> Screen Savers, I can set the source of the screen saver to be my NAS, and it is great.

    However, after each power cycle, this reference to our family photos is lost and the system reverts to the built in images.

    Does anyone have a script / program / method for having the Mac auto-reconnect to this network drive and set the Screen Saver settings?

    ---

    I have tried my hand at Automator, but I suck at it.

    I have tried a macro recorder which sort of works, but our screen resolution changes often so ABSOLUTE mouse paths are not a viable solution.

    I have tried Wally which doesn't set the screen saver and was actually sort of limited in this area.

    ---

    Any thoughts?

    This should be simple, right?
     
  2. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
  3. mainstay thread starter macrumors 6502

    mainstay

    Joined:
    Feb 14, 2011
    Location:
    BC
    #3
    Do you have a copy of the code to perform this function?
     
  4. mainstay thread starter macrumors 6502

    mainstay

    Joined:
    Feb 14, 2011
    Location:
    BC
    #4
    So, does anyone have any actual answers to this question?

    If the answer is no, then OK... so be it, Mac can't do it.

    If the answer is yes, then, "yes, it can be done" doesn't really help much.

    I'm looking for something along the lines of, "yes, this program/script/whatever does it... it's only $x"....

    thanks guys!
     
  5. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #5
    I completely forgot about this. Let me see if I can create something a bit quick here.
     
  6. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #6
    Alright, I have no idea if this will work. I didn't test it. Basically copy and paste it into a blank Applescript document and try it out.

    Code:
    set volumeName to "PUT VOLUME NAME HERE" --The name of the mounted volume
    set userName to "USERNAME" --The username that is needed to mount the volume
    set userPass to "PASSWORD" --The password that is needed to mount the volume
    set nasAddress to "ADDRESS" --The IP or Bonjour address of the NAS
    set fsKind to "AFP" --The network fileshare type: afp, smbfs, ftp, or nfs
    set directPath to "PATH" --This must be the direct path of the folder that stores the pictures. Example /Volumes/Macintosh HD/Users/Intell/Pictures/Background/
    
    try
    	do shell script "mkdir /Volumes/" & volumeName & "; mount_" & fsKind & " " & fsKind & "://" & userName & ":" & userPass & "@" & nasAddress & "/" & volumeName & " /Volumes/" & volumeName & "/"
    on error errMsg
    	display dialog "Something went wrong: " & errMsg
    end try
    
    try
    	do shell script "defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedFolderPath " & directPath
    on error errMsg
    	display dialog "Something went wrong: " & errMsg
    end try
    
     
  7. mainstay thread starter macrumors 6502

    mainstay

    Joined:
    Feb 14, 2011
    Location:
    BC
    #7
    this is something to bite into - thank you!

    "Expected end of line, etc. but found unknown token."

    it's in the write to com.apple.etc. section...

    will try and learn some syntax and go from there.

    Thank you for the help!
     

Share This Page