Automation script for Mac 43 folders Desktop

I wrote an extremely simple AppleScript to create a 43 Folders setup on my Desktop, wherein I can put a file away for now and have it show up again automatically on a given day in the future. The script assumes there’s a folder named “43 Folders” on the Desktop, containing folders named with the following date convention: 20200704 for July 4th, 2020.

Picture of AppleScript

Then I used “Poor Man’s Cron” to automate this every morning: save the script as an application, store in ~/Applications, and launch it with a repeating event in my calendar every morning at 8 AM. Note: you’ll have to manually launch the app once the first time, in order to tell the Finder that it’s okay to run the app, and that the app has permissions to do the things it wants to do.

On the to-do list is to add a few lines of code to make the folders into the friendlier “2020-07-04” format, which I’ll post here when I get around to it.

Process 43 folders.scpt.zip

WhereFrom 1.0

If you save an item from your web browser, Finder’s Get Info will show you its original URL. But there’s no way to get that information as selectable text later, unless you want to do it in Terminal and know the vagaries of the mdls command. Waaaaay too complicated.

So here’s a quick script that solves that problem. Highlight any .webarchive file (or other files which have Where From information), and up pops a dialog box with that information in all its selected text goodness. (Technical details: the script gets it from mdls with flags -raw, and -name kMDItemWhereFroms. Heck, I know how to use mdls, and I think that’s too much typing.)

Download wherefrom-10.scpt.zip.

Creative Commons License
WhereFrom 1.0 by Jeff Porten is licensed under a Creative Commons Attribution 3.0 United States License.

Lessig’s One-Click Retweet for Twitterrific

picture-1

Larry Lessig wanted a one-click retweet command for Twitterrific, so I wrote him one in AppleScript. And since I have no idea how to send Larry Lessig an uninvited email with an attachment without getting bitbucketed, I’ll post it here for everyone to download.

Usage: running this script will immediately retweet the selected tweet in Twitterrific, with no other UI. Period, end of story. If you don’t want to immediately retweet to all of your followers, I suggest you don’t run this script.

Lessig’s One-Click Retweet for Twitterrific 1.01

Creative Commons License
Lessig’s One-Click Retweet AppleScript by Jeff Porten is licensed under a Creative Commons Attribution 3.0 United States License.

Pause, Dammit! 1.3 beta

Ever need silence now?

Pause, Dammit! allows you to quickly play or pause either iTunes or PandoraJam, using a single keystroke or menu item to open and control both players.

Why is this useful?

  • You’re listening to music and need to stop it quickly without thinking about which application you’re listening to. This script will do that.
  • Once you’re in the habit of using a menu item or keystroke to play your music, it’s really useful if the same action asks you which one you want when nothing is open, or you haven’t listened for a while.
  • If you’re using PandoraJam Launcher, the same keystroke will open it instead of the Pandora application, avoiding mistakes you might make using other launch utilities.

About the beta: I’ve tested this fairly thoroughly during development, but I’m still putting this script through day-to-day usage and adding features.

Drop me a line if you have any problems. PayPal donations gladly accepted.

Download Pause, Dammit! 1.3 beta

PandoraJam Launcher 1.04

A workaround AppleScript to allow launching PandoraJam when ClickToFlash is installed. (Details on how ClickToFlash breaks PandoraJam can be found here.) Dead simple operation: it moves the plugin to your Desktop long enough to launch PandoraJam, then puts it back. The script doesn’t handle permissions at all, so if you’re using a non-admin account and the plugin is in your top-level Library, you may be asked for an admin password, or denied access.

I’m shipping this as an application to make it easy to use — just put it in your Dock (or redirect Quicksilver or Launchbar to it), and use it instead of the PandoraJam icon when you want to listen.

Drop me a line if you have any problems. PayPal donations gladly accepted.

Download PandoraJam Launcher 1.04

Make a TextEdit document with a series of track descriptions

In case it’s useful to anyone: a simple AppleScript that will take a selected set of iTunes tracks (i.e., podcasts you’ve downloaded), compile all of their descriptions, and create a new TextEdit document with the whole text. Useful if you have a pile of downloaded podcasts and you want to skim through to see what to keep.

tell application "iTunes"
	set trackreport to ""
	repeat with eachtrack in (get selection)
		set trackreport to trackreport & name of eachtrack¬
			& ": " & description of eachtrack¬
			& return & return
	end repeat
end tell

tell application "TextEdit"
	set newdoc to make new document
	set text of newdoc to trackreport
end tell

Noguchi Desktop filing

A quick hack AppleScript which takes everything on your Desktop without a color label and shoves it into a new Desktop folder named “061229”, or whatever day it happens to be. Useful for cleaning up yesterday’s detritus if you haven’t had time to deal with it yet.

(Apologies for the PNG upload — I can’t be bothered to figure out why WordPress is blowing out the new style sheet.)

formatted script; download the attachment for fulltext

Noguchi Desktop.scpt.zip

TidBITS GTD AppleScripts

Looking for the AppleScripts I mentioned in my TidBITS GTD article? Here you go. And here’s the readme, which you really should read.

scripts 1.01.zip

Jeff’s GTD AppleScripts
© 2006 Jeff Porten

Thanks for reading my GTD article and downloading these scripts. This readme provides a walkthrough for using these scripts on a day-to-day basis. You’ll need to do some setup to get them working on your Mac — but you only need to set them up once, and then they’re good (nearly) forever.

These scripts are all battle-tested on OS X 10.4. They might work on 10.3; no guarantees. They might break on your Mac, in a non-damaging way. If so, let me know and I’ll try to post a fix. But notably, the long-suffering people at TidBits haven’t seen these or edited this document, and I’m providing the standard “no warranty express or implied” disclaimer should anything go wrong. Backups are your friend.

Setting up your Mac for easy AppleScripting

You’re going to want to have a quick method of launching your scripts. The easiest way to do this is to activate your script menu. In Tiger, run the AppleScript Utility (in the Applications > AppleScript folder), and choose “Show Script Menu in menu bar”; a scroll icon (it’s an S, get it?) will appear in the upper-right section of your menu bar. (In Panther, look for an application called “Install Script Menu”, which does the same thing.)

You can organize your script menu as you like; Apple’s documentation for how this works is here:

http://www.apple.com/applescript/scriptmenu/02.html

Finally, I strongly recommend an AppleScript launching utility so you can fire off a script with a keystroke. I like Quicksilver, which is powerful and highly complex. There are about a thousand other options, which are discussed in detail in the 43 Folder list archives and website.

http://quicksilver.blacktree.com/

Editing these AppleScripts

Double-click on an AppleScript and it will open in Script Editor. Don’t worry if you don’t know how to use AppleScript; these instructions will walk you through the process. However, it’s useful to know three things:

1) Script Editor will format the text of a finished script to make it look pretty. When you make changes, your changes appear in a different font. This is normal.

2) Comments in AppleScript start with “–“; look there for my notes on what to change.

3) When you’re done with your edits, click the “Compile” button; if everything gets reformatted pretty, you know you have a working script. It might not do what you want it to do, but it “works”….

Comment and label selection

This script will set the label (i.e., the background color) of a Finder selection to yellow, and will ask you for a comment to add. If you have multiple files selected, it will do this to all such files. Probably a good idea not to have 300 files accidentally selected when you launch this script.

If you don’t like yellow, you can change the number 3 to something else at the commented line of the script. If you want multiple colors, copy the script a few times and set each one to a new color. I deliberately did not do this because I thought it was a bit too complicated, but have fun.

Get Alias URL

This is one of those things that should be simple, but is really complicated. At least, the AppleScript is complicated; running it should be simple.

This script will create a new folder called AliasFiles in your Application Support folder, and will stash aliases there so any URLs you create will continue to work no matter where you put the original file. There’s no cleanup utility, so you’ll have a lot of files living here; on the other hand, they’re all tiny and it’s hard to tell when you’re finished using them, so I just leave mine there forever.

Select a single file and an alias will be created to it alone. Select a group of files and they’ll be put into a single folder, with an alias created to that. The URL for this alias will be placed on your clipboard, so you can paste it wherever you like. (Note: don’t have anything you care about already in your clipboard — this will replace it.)

If you have Growl installed, a popup window will tell you that the alias was created.

http://www.growl.info/

Open Some Someday Item

This was definitely a case of making pretty stacks of sandwich orders, but it’s fun. Point this script to your Someday folder, then launch it and it’ll randomly pick out a waiting file and ask you if it’s okay to work with it. If you agree, it’s labeled and stashed on your desktop. If not, you can tell it to pick another. The script is preset to look for a “Someday” folder in your user folder. You can edit it to look for another.

Tickler folder setup

This script will create one folder for every day from now until whenever you like; by default, it’s the next 90 days. Set it to 365 or 3650 if you really don’t want to think about this again for a while. By default, it looks for a folder called “43 Folders” in your home folder.

Tickler file management

This script is designed to launch once a day to move files from your 43 Folders to your desktop. Note: there’s no error-checking in this script, so if you get an error message in the morning, it probably means you already have a file on your Desktop with the same name as a file in your tickler folder. I’ll bet you a dollar you’ll do this sooner or later with a file named “Picture 1”. If this happens, go ahead and manually move your files around for today.

By default, this script looks for ticklers in a folder named “43 Folders” in your home folder. If you changed this in your setup script, you’ll need to change it here too.

Once the script is set up, you’ll need a way to launch it on a daily basis. I have a repeating daily event in my iCal set up to launch this script for me, which is very similar to what is mentioned here:

http://www.macgeekery.com/tips/poor_mans_cron

Troubleshooting

All of these scripts have been in extensive use on my Mac since sometime after the Industrial Revolution. They work fine here. Whether they’ll work on your Mac, I have no idea. But I’ll be glad to make reasonable efforts to that effect, especially if many people have the same problems.

Again, there’s nothing dangerous about these scripts — the only thing that ever gets deleted is an empty tickler folder. That being said, you assume all risk and responsibility yadda yadda yadda.

And while it’s not required, folks who’ve made a PayBits contribution will probably get more attention if they have a problem with the scripts. For example, they’ll get an email when I post an update to the scripts. If you’ve already contributed for part 1, don’t worry, you’re already one of my favorite people.

PayBITS: Has Jeff helped bring order to your life? Show your appreciation via a PayBITS donation! http://www.paypal.com/xclick/business= civitan%40jeffporten.com Read more about PayBITS: http://www.tidbits.com/paybits/

AppleScripting a team of monkeys to jump on your pillow

So let’s say it’s 3 AM, and you’ve got an important meeting in, oh, 6 hours, and you don’t quite trust yourself to wake up when the alarm goes off.

Voila. An AppleScript that will bide its time for a while, and then will tell you loudly, over and over, to get your ass out of bed. The voice changes randomly to prevent you from somnambulantly acclimating to it before the higher brain functions kick in.

monkey.png

team of monkeys.zip

AppleScript String to Property Coercion 1.0

AppleScript String to Property Coercion is a set of subroutines that allow you to treat strings as property declarations within your scripts. addPropToString will create new properties or replace existing ones, returning a string that looks exactly like an AppleScript property statement. getPropFromString returns the value of a selected property, returning an empty string if the property does not exist.

Freeware, suggested donation: 15 minutes of your billable rate
Tested under: Mac OS X 10.2 and up

Download AS_S2PC101.zip

MessageLaser 0.1

An AppleScript which allows arbitrary tagging of messages in Mail.app. Select any number of messages in Mail.app, and you’ll be prompted for whichever comments you want to add. These will be added to the Finder Spotlight comments of the files for these messages, and will immediately be available in global Spotlight searches.

Note: a bug has been found with Mail.app handling of moved messages. MessageLaser comments are lost if the message is moved. MessageLaser development has been discontinued; I recommend Indev’s MailTags.

Freeware, suggested donation: $10
Requires: Mac OS X 10.4

Download MessageLaser.zip