77 Comments
- dtd00d, on 10/12/2007, -9/+60OMG it's a png overlaying text...
- saggygrandma, on 10/12/2007, -4/+46who cares, it loaded in a second and he went out of his way to write this tutorial for you so stop whinging.
- cablefish, on 10/12/2007, -7/+46I'm in UR layers stealing UR TXT
- ocellnuri, on 10/12/2007, -1/+35No web designer involved here. It was made with iWeb. Not everyone writes code for a living.
Great tutorial. I've been trying to set something like this up for a long time. Nice to see someone put it out step-by-step! - mjar81, on 10/12/2007, -1/+20sorry for hijacking the comment thread, but:
Entering Proximity.scpt
-- Disable the screen Saver Password
do shell script "defaults -currentHost write com.apple.screensaver askForPassword -int 0"
do shell script "notif"
-- Turn OFF the screen saver
tell application "ScreenSaverEngine" to quit
tell application "Address Book"
if not unsaved then
try
quit
delay 1
end try
end if
end tell
-- Reconnect to the Address Book
do shell script "defaults write com.apple.AddressBook ABCheckForPhoneNextTime -boolean true"
try
tell application "Address Book" launch
end tell
tell application "System Events"
set the visible of process "Address Book" to no
end tell
end try
-- Synchronize the Device
tell application "iSync"
if last sync is less than ((current date) - 900) then
synchronize
end if
end tell
tell application "System Events" to set visible of process "iSync" to false
Leaving Proximity.scpt
-- Turn off the screen saver password
do shell script "defaults -currentHost write com.apple.screensaver askForPassword -int 1"
do shell script "notif"
-- Activate the screen saver
tell application "ScreenSaverEngine" to activate - Prometheus, on 10/12/2007, -2/+18I thought I had accidentally highlighted everything... when in actuality, I did.
- Ricapar, on 10/12/2007, -17/+32What kind of screwed up web designer uses an image for the TEXT of the entire context of the page? wtf.
- eihwaz, on 10/12/2007, -2/+15Yep, that's the disgusting way iWeb worked with strange fonts. I think they've fixed it in a later release.
- mikev, on 10/12/2007, -1/+11Mom must be proud
- TravisG5, on 10/12/2007, -4/+13It is so the IGeeks don't copy and paste the text.
- madmac625, on 10/12/2007, -0/+7--This is my 'away' script. The first line sets the away message text as a variable, which it uses later (not quite sure if you can/how to do it directly)
--The 'if' statement means it will only set to the custom away message if you were originally available, so it won't screw up any previous away messages already in place.
set adiumstatus to "I am at least 30 feet away from my computer right now. I may or may not be back momentarily."
tell application "ScreenSaverEngine" to activate
tell application "Adium"
if my status type is available then
set my status type to away
set my status message to adiumstatus
end if
end tell
--What exactly are you trying to make it do? - iBookG4, on 10/12/2007, -0/+7I wasn't able to get the above script to work. It asks for the location of ScreenSaverEngine, which is seemingly missing from my 10.4.9 install? Instead, I hacked together (using the article and other AppleScripts from the web) the following script (and added Adium support):
http://www.tswartz.com/files/Archive.zip (I'm using these with Proximity, linked in the article.)
The "away" script sets your Adium status to away, pauses iTunes and turns your screensaver on (and turns on the password setting for screensaver as well) when the phone leaves proximity. Upon entering proximity, the "available" script sets your Adium status to available and turns off the screensaver (and the screensaver password setting) without requiring a password.
THE ONLY REQUIREMENT to make it function is you need to go into Universal Access and check "Enable access for assistive devices" (this allows the screensaver password setting to be turned on/off automatically). - dioxide, on 10/12/2007, -0/+7looks like all the plain text is in the alt tags. just view the source if you need to c&p it.
- drouk1556, on 10/12/2007, -1/+8Or just view source...?
- Justin6512, on 10/12/2007, -0/+6I made it so when I get home it plays "Welcome Back" on my surround sound!!!! :)
MAC'S ROCK! - mikespez, on 10/12/2007, -0/+6I tried this with my Macbook and Treo 650. I'm not sure if I did it correctly, because here's what happened:
I created the applescripts, installed proximity, etc.
When I would enter the room it would take too long for the computer to recognize my cell phone and deactivate the screen saver, so I told Proximity to scan every 1 sec for my phone. But when I did this, the computer would connect and disconnect, connect and disconnect repeatedly via bluetooth to my Treo every second, which, if I let it continue, would drain the Treo battery in short order. - lawnmowerlatte, on 11/06/2008, -0/+6Anyone know about true proximity monitoring (not just in/out of range) using Bluetooth? I took this for a test drive with my Wii remote and it didn't go out of range until I was halfway down my dorm's hallway. Is there any way to calculate distance using Bluetooth signal strength?
- nipterink, on 10/12/2007, -1/+6@terranaut: did you even read? he said not all of the work was his own, and his intentions were to make it easier for everyone to implement it themselves.
- smartssa, on 10/12/2007, -3/+8@terranaut:
wth is the point of posting something useful like that if users can't copy & paste? "omg! someone's gonna steal my code!" I have my doubts that the user did it intentionally. As stated above, it's an annoying way that iWeb posted crap when the author used non-web-friendly fonts. - thetheaterimp, on 10/12/2007, -0/+5Can someone please post the "notif" script or explain how to make. I have never coded in my life and all of this pretty much flies way over my head
- Sabretooth, on 10/12/2007, -0/+4Here you go:
http://uplued.com/SA/notif.tar.gz
Compiled (on 10.4.9 Intel, gcc version 4.0.1 (Apple Computer, Inc. build 5363) ) by copying the code into 'notif.cpp' and executing:
`g++ -o notif -framework CoreFoundation -O2 -Wall -arch i386 -arch ppc notif.cpp`
which generates a universal binary, suitable for both Intel and PPC macs. - ggypsy, on 10/12/2007, -0/+4madmac, please do post it. I, however, am a complete AppleScript newbie and can't get it to work at all. :(
When I try to run it in Script Editor to test it out, I get a box that pops up asking where "ScreenSaverEngine" is, then when I cancel, it gives me a syntax error. So I remove that part of the script, hoping to at least get the syncing working... and I get the following:
"Syntax Error
"Expected end of line but found command name."
Anyone have any advice for me? - cklol, on 10/12/2007, -0/+4Wow.. I never knew applescript was so easy to use and so powerful! Thanks a ton guys!
- madmac625, on 10/12/2007, -0/+3Could someone who did this post the scripts or code? He talks about compiling the bottom portion about enabling/disabling the password request, and would love just the file or code to get it working. Thanks a lot.
- madmac625, on 10/12/2007, -0/+3I got some of it to work with my SE Z525. It now sets my screensaver and puts up a custom away message in adium. When I come back, it removes that message and puts it back as available and takes my screensaver off. The kinda neat thing is that I got it to only do this if I didn't already have an away message set. If I have an away message set already, it just leaves it alone, very rudimentary but neat to me none the less. I'd still like to do the password settings though. If anyone wants to see the code for what I did, just ask and I'll post it.
- cklol, on 10/12/2007, -0/+3Sorry for double posting but...
These scripts, which are a combo of both posted things, seem to work really well for me:
--Available
tell application "System Preferences"
activate
set current pane to pane "Security"
tell application "System Events"
try
tell application process "System Preferences"
tell window "Security"
if value of checkbox 1 is 1 then
click checkbox 1
ignoring application responses
tell application "ScreenSaverEngine" to quit
end ignoring
end if
end tell
end tell
tell application "System Preferences" to close the first window
end try
end tell
end tell
tell application "iSync"
if last sync is less than ((current date) - 900) then
synchronize
end if
end tell
tell application "Adium" to activate
tell application "System Events"
tell process "Adium"
tell menu bar 1
tell menu 1 of menu bar item "Status"
click menu item "Available"
end tell
end tell
end tell
end tell
tell application "iTunes"
if the player state is playing then
pause
return "Pause"
else
play
return "Play"
end if
end tell
--Away
tell application "Adium" to activate
tell application "System Events"
tell process "Adium"
tell menu bar 1
tell menu 1 of menu bar item "Status"
click menu item "Away"
end tell
end tell
end tell
end tell
tell application "System Preferences"
activate
set current pane to pane "Security"
tell application "System Events"
try
tell application process "System Preferences"
tell window "Security"
if value of checkbox 1 is 0 then click checkbox 1
tell application "ScreenSaverEngine" to activate
end tell
end tell
tell application "System Preferences" to close the first window
end try
end tell
end tell
tell application "iTunes"
if the player state is playing then
pause
return "Pause"
else
play
return "Play"
end if
end tell - duranracing, on 10/12/2007, -1/+4The swallows for people trying to just copy and paste the freaking totorial, Though i love this!!
- mikev, on 10/12/2007, -1/+4Tell this to Mrs. IGeek ;]
- madmac625, on 10/12/2007, -0/+3--Give this a try, I'm still looking at some other ways. I'm not exactly in expert in applescript but I know my way around a few simple commands.
tell application "ScreenSaverEngine"
activate
end tell - inactive, on 10/12/2007, -0/+3the script notif:
#include
int main(int argc, char ** argv)
{
CFMessagePortRef port = CFMessagePortCreateRemote (NULL, CFSTR
("com.apple.loginwindow.notify"));
CFMessagePortSendRequest (port, 500, 0, 0, 0, 0, 0);
CFRelease(port);
return 0;
} - CLShortFuse, on 10/12/2007, -1/+4My friend in college showed me Float Mobile Agent which does the same thing in windows. used to use it back in 2003 when i had my Sony Ericsson T616. open source too.
http://fma.sourceforge.net/ - ggypsy, on 10/12/2007, -0/+3Work, as written. I tried copying and pasting from the comment above that included the script text, which is when I got the errors listed.
- swindmill, on 10/12/2007, -0/+3BluePhoneElite does proximity detection and a ton more. It's the only shareware I use.
- ggypsy, on 10/12/2007, -0/+310.4.8
- Angostura, on 10/12/2007, -0/+3Hmmm, it would be difficult wouldn't it? Assuming every device produces its own signal strength (variable due to battery strength?) and each building has different transmission properties you would need to spend a long time calibrating each individual device.
- Agret, on 10/12/2007, -0/+3Haha the Wii has awesome range, i'd use it on another device if possible. Who carries their Wii remote everywhere anyway?
- madmac625, on 10/12/2007, -0/+3--I got errors using the code posted by mjar81 too.
tell application "ScreenSaverEngine" to activate
--Should work just fine, what version of OS X are you running? - inactive, on 10/12/2007, -2/+5@parapa
well, yes and no; it's not going to be impossible, but good luck on wading through your bluetooth drivers and finding a simple solution
os x ftw - madmac625, on 10/12/2007, -0/+2Nevermind, I got it to completely work. Thanks for the help, if anyone still needs anything, let me know.
- madmac625, on 10/12/2007, -0/+2@Sabretooth
How do I use the file in my script? I dumped the file to my applications folder, and it opens in Terminal when I double click it. How do I call on it in the script? Thanks a lot. - madmac625, on 10/12/2007, -0/+2--Download the notif file and put it in your user folder. This will activate the screensaver, put a custom away message up, and pause iTunes, if they are open, and will also password protect your computer. The following script will turn the screensaver off, put your status as available only if it changed it in the previous script and will show a small dialog asking if you want iTunes to continue playing the music.
--On leaving
set adiumstatus to "I am at least 30 feet away from my computer right now. If we were in the middle of an intriguing conversation, don't fret, I should be back in a minute. If we weren't, your guess is as good as mine."
tell application "ScreenSaverEngine" to activate
tell application "System Events"
if ((get name of the processes) contains "Adium") then
tell application "Adium"
if my status type is available then
set my status type to away
set my status message to adiumstatus
end if
end tell
end if
tell application "System Events"
if ((get name of the processes) contains "itunes") then
tell application "iTunes"
if player state is playing then
pause
end if
end tell
end if
do shell script "defaults -currentHost write com.apple.screensaver askForPassword -int 1"
do shell script "~/notif"
end tell
end tell
--On returning
set adiumstatus to "I am at least 30 feet away from my computer right now. If we were in the middle of an intriguing conversation, don't fret, I should be back in a minute. If we weren't, your guess is as good as mine."
set adiumstatus2 to ""
tell application "ScreenSaverEngine" to quit
tell application "System Events"
if ((get name of the every process) contains "Adium") then
tell application "Adium"
if my status message is adiumstatus then
set my status type to available
set my status message to adiumstatus2
end if
end tell
end if
tell application "System Events"
if ((get name of the every process) contains "iTunes") then
display dialog "Continue Music?" buttons {"Cancel", "OK"} default button 2
set the button_pressed to the button returned of the result
if the button_pressed is "OK" then
tell application "iTunes"
if player state is paused then
play
end if
end tell
end if
do shell script "defaults -currentHost write com.apple.screensaver askForPassword -int 0"
do shell script "~/notif"
end if
end tell
end tell - smartssa, on 10/12/2007, -3/+5horrible web page, but great scripting and detail...
- ActionableMango, on 10/12/2007, -0/+2This is similar to something I've thought would be a killer app for phones. What I need is the ability to automatically change the phone's noise profile based on bluetooth proximity. In other words, when I get to work, go into silent mode. When I leave work, go back to normal mode.
It would be great if this were an open standard and, for example, all phones would go into silent mode upon entering a movie theater. - jhollington, on 10/12/2007, -0/+1For what it's worth, I've now moved the page to a *real* blog server (based on WordPress). The great iWeb blog experiment is done for good.... I thought I was using web-safe fonts (and my previous pages didn't have any issues in that regard), but for whatever reason I was unable to get it to render in any way other than one big PNG (blech).
It's now happily living back on my WordPress blog, and I've migrated all of the relevant comments to the WordPress blog as well.
The link above will still go to the .Mac page, but there's a redirect there now that should automatically take you over to the WordPress blog. The direct link is http://www.technocrat.ca/?p=44 - monkeymad2, on 10/12/2007, -0/+1How you get it to work madmac?
- meesterfox, on 10/12/2007, -0/+1i made mine put up a special locked screen saver when i was not in proximity to the computer. I just created an image and then created an iphoto album and put it in there. now, when i am not in proximity, the script changes the screen saver to that one and activates it, displaying a "this computer has been locked" image.
when back in proximity, it reset it to my normal one.
do shell script "defaults -currentHost write com.apple.screensaver moduleName systemlocked"
do shell script "defaults -currentHost write com.apple.screensaver modulePath systemlocked.iPhotoAlbumSaver"
do a spotlight for com.apple.screensaver and then open the file to see what's inside it. that's how i started. also useful for troubleshooting.
you don't want the -int. if you read the article, you'll know why. I for one, didn't, and screwed things up for a bit. - chriswilson08, on 10/10/2009, -0/+1Has anyone been able to get the toggle screensaver script to work with Snow Leopard?
- panique, on 10/12/2007, -0/+1Who gives a *****? Seriously, get a life.
- alecks, on 10/12/2007, -0/+1yeah, i love BPE... version 2 allows talking to your mac as if it were a handsfree headset.
- iBookG4, on 10/12/2007, -0/+1Sony Ericsson M600i? Been working awesome for me.
-
Show 51 - 77 of 77 discussions



What is Digg?