43 Folders

43 Folders feed subscription icon - Shiny!Time, Attention, and Creative Work. After 4 years and a lot of productivity pr0n, we’re shifting gears. Re-learn how to use 43 Folders. Then back to work. [»]

”What’s 43 Folders?”
43Folders.com is Merlin Mann’s website about finding the time and attention to do your best creative work.

osx assisted anti-procastination hack?

Most of my procrastination comes in the form of surfing the web, reading RSS feeds, or checking email.
Do you know if an applescript can turn off airport for a specific time?
This would be a great anti-procastination hack. Even better if it would be Password protected and is shouting "Cheater" at you if you try to bypass the lockout ;)


TOPICS: Mac OS X

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
spalmer47's picture

How about a free timer...

How about a free timer program and a simple Applescript? I'm in favor of shutting down the applications you're using to procrastinate instead of turning off the Airport card because you can still read RSS feeds and email while offline.

Here's a free timer program, set it to run your script when the timer reaches zero.
http://www.chimoosoft.com/timer.html

Here's a simple Applescript complete with admonition. Fire up the script editor, cut and paste between the lines and save it as an application. You can add three more "tell" lines for each application, Mail, NNW, etc.
----------------
set the message to "Stop surfing and go Get Things Done!"

display dialog the message buttons {"OK"} default button 1

tell application "Safari"
quit
end tell
------------
There is no cancel and no snooze button - it all goes away. Good luck!

stangster's picture

Thank you Scott, I'definitly try...

Thank you Scott, I'definitly try this

visciousfishes3000's picture

How about a free timer...

spalmer47;329 wrote:
How about a free timer program and a simple Applescript? I'm in favor of shutting down the applications you're using to procrastinate instead of turning off the Airport card because you can still read RSS feeds and email while offline.

Here's a free timer program, set it to run your script when the timer reaches zero.
http://www.chimoosoft.com/timer.html

Here's a simple Applescript complete with admonition. Fire up the script editor, cut and paste between the lines and save it as an application. You can add three more "tell" lines for each application, Mail, NNW, etc.
----------------
set the message to "Stop surfing and go Get Things Done!"

display dialog the message buttons {"OK"} default button 1

tell application "Safari"
quit
end tell
------------
There is no cancel and no snooze button - it all goes away. Good luck!

I found this post when I was searching for a way to turn off AirPort with applescript, is there any script I can use for my "Dark Mode" program? Thanks!

Sarge's picture

This sounds like a good...

This sounds like a good idea and would love to give it a try. I'm relatively new to macs and was wondering how do you set up the applescript (I got that far) to work in conjunction with chimoo timer?

Todd V's picture

re: Scheduling the Script

Sarge;6369 wrote:
This sounds like a good idea and would love to give it a try. I'm relatively new to macs and was wondering how do you set up the applescript (I got that far) to work in conjunction with chimoo timer?

You can also use iCal instead --
Just create a new event to repeat daily or hourly at whatever interval you want, and instead of choosing "send me an email" or "chime at me" for the alarm you can have it "Open File" and have it run your script. When you save the applescript you should save it as an "Application" rather than as a script, then do the above using iCal.

I wrote a script for processing the inbox on the mac desktop (along with others), and as one of its features, it closes whatever web browser someone is using if the person is processing a web-item from their inbox. I just drag webpages to this inbox folder on my desktop; and when I process them the script keeps me focused instead of getting lost in cyberspace.

It's accessible here. A rather large download (~100MB) because it is a full GTD implementation for the mac -- and contains three Quicktime movie tutorials on juggling the 9 core GTD habits.

http://homepage.mac.com/toddvasquez/apps

Todd V

noodle's picture

airport off

I was bored. And I've been wondering about the Airport off thing myself. I've scoured the net and there's apparently not a real easy way to turn off Airport, meaning that you have to use a GUI instead of just typing a command. Real annoying.

tell application "Internet Connect" to activate

tell application "System Events"
	tell process "Internet Connect"
		if not (exists window 1) then
			keystroke "n" using command down
		end if
		
		if not (exists window "Airport") then
			click button "airport" of tool bar 1 of window 1
		end if
		
		if exists button "Turn Airport Off" of window "Airport" then
			click button "Turn Airport Off" of window "Airport"
		end if
	end tell
end tell

tell application "Internet Connect" to quit

visciousfishes3000's picture

Thanks, that is perfect!...

Thanks, that is perfect!

Todd V's picture

you have to use a...

noodle;6432 wrote:
you have to use a GUI instead of just typing a command.

Also, make sure you have "Enable access for assistive devices" checked in the "Universal Access" System Preferences pane, otherwise the GUI script won't work.

noodle's picture

... Do you know if an...

stangster;311 wrote:
...

Do you know if an applescript can turn off airport for a specific time?
This would be a great anti-procastination hack. Even better if it would be Password protected and is shouting "Cheater" at you if you try to bypass the lockout ;)

This isn't an applescript, but a writing program which cuts off all network access. You do have to do some setup. (I haven't tried it yet. Too busy surfing the net.)

Whome?'s picture

Turning off airport

There's a way to disable airport from the terminal:

sudo ifconfig en1 down

Where en1 is the interface for your Airport Extreme Card. en0 is usually Ethernet, and en1 is usually the Airport Extrewme card. To bring it back up, just type:

sudo ifconfig en1 up

I don't know much about UNIX or applescript, I got this from someone on another forum.

Is there a way to link this to an applescript that will keep you offline for a certain amount of time (instead of AT a certain time)?

Will power isn't cutting it these days.

About stangster

 
EXPLORE 43Folders THE GOOD STUFF

An Oblique Strategy:
Not building a wall; making a brick


STAY IN THE LOOP:

Subscribe with Google Reader

Subscribe on Netvibes

Add to Technorati Favorites

Subscribe on Pageflakes

Add RSS feed

The Podcast Feed

Inbox Zero

The original 43 Folders series looking at the skills, tools, and attitude needed to empty your email inbox — and then keep it that way. Don’t miss the free video of Merlin’s Inbox Zero presentation.

Making Time

3-part series on attention management for artists and makers. Read Bad Correspondence, The Job You Think You Have, and One Clear Line.