3 Replies Latest reply: Mar 9, 2012 7:09 AM by fane_j
Sori Heimsson Level 1 (0 points)

I need to set the page setup as A4 for all users.

Preferably with an applescript I can set as a login hook as users login.

Any help would be nice.

Thank you.

  • fane_j Level 4 (3,660 points)

    Try this

     

    --script begins

    on run

              do shell script "defaults write com.apple.print.PrintingPrefs DefaultPaperID 'iso-a4'"

    end run

    --script ends

     

    I assume you know how to set it up to run at login.

  • Sori Heimsson Level 1 (0 points)

    Thank you very much.

    This works either as an .app or .scpt when run.

     

    My problem is however that it does not work in combination with this solution:

    http://support.apple.com/kb/HT2420?viewlocale=en_US

    on how to make it run at login for all users.

  • fane_j Level 4 (3,660 points)

    Sori Heimsson wrote:

     

    My problem is however that it does not work in combination with this solution:

    http://support.apple.com/kb/HT2420?viewlocale=en_US

    on how to make it run at login for all users.

    (1) A login hook requires a shell script, not an AppleScript.

     

    (2) I believe that login hook has been deprecated in SL (the KB item you quoted applies to 10.5 and lower).

     

    (3) Save the script as an app and implement it as a LaunchAgent (as described in "Creating Launch Daemons and Agents" in "Daemons and Services Programming Guide" in Apple's Developer library). Save the .plist in </Library/LaunchAgents> and it will apply to all users. It's the preferred method in SL, and, IMHO, superior to the login hook.

     

    HTH