Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sloppyseconds

macrumors newbie
Original poster
Jun 5, 2014
1
0
For the longest time, I have wanted to be able to use Windows screensavers in my iMac. Quite frankly, there are many Windows screensavers that I have liked a whole lot better than the ones available for OS X. Well, I finally figured out a way for it to work and also have the screen locked after you close the screensaver.

To get this dirty hack to work, you first need wine. You can get it easily via MacPorts:
Code:
sudo port install wine
. Second, you need the Keychain Access padlock icon showing on the menu bar. To do that, open Keychain Access and then open up the preferences and then check, "Show keychain status in menu bar." Next, you then open Applescript editor and paste this in:

Code:
do shell script "opt/local/bin/wine /Users/username/path/to/screensaver/file.scr /s"

activate application "SystemUIServer"
tell application "System Events"
	tell process "SystemUIServer"
		repeat with i from 1 to number of menu bar items of menu bar 1
			tell menu bar item i of menu bar 1
				click
				try
					if name of menu item 1 of front menu is "Lock Screen" then
						click menu item "Lock Screen" of front menu
						exit repeat
					end if
				end try
			end tell
		end repeat
	end tell
end tell

The very first part of the Applescript opens up the screensaver using Wine. The second part locks the screen after the screensaver closes.

The only part wrong with all this is that there is this 10 second delay between when the screensaver is deactivated & when the screen gets locked. Can anybody please tell me how in the world could that delay be removed? Thanks.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.