Home
Mike's AutoMagical AppleScript Solutions Below are the 16 most recent journal entries recorded in the "Michael Henley" journal:
December 29th, 2005
10:16 pm

[Link]

10.4 Menu Extras scripting
In 10.4 we can land clicks on Menu Extras using System Events. It's a bit complicated by the fact that most menu extras don't have titles, and they can be placed in any order the user wishes.

The first time you run this script, it will start looking in your menu bar for the Bluetooth menu, and then use it to toggle Bluetooth on or off. On subsequent runs the script will have remembered where the Bluetooth menu is, and will just click it immediately. If the menu is later moved or removed, the script will go looking for it again. Read more... )

(2 comments | Leave a comment)

December 28th, 2005
12:02 pm

[Link]

Browse CoreTypes Icons
This is a script I wrote and posted to Apple Lists. It lets you see how various built-in system icons look when used in AppleScript dialog boxes. You can copy out the titles of your favorites, view them as a timed slideshow, pick one from a list, etc. When you quit the script it generates generic dialog code with the appropriate resource reference. Read more... )

(Leave a comment)

December 8th, 2005
02:05 pm

[Link]

Fun with hijacking command parameters
So I discovered an exciting new behavior in AppleScript today. That is you can 'hijack' commands and make them do pretty much whatever you want, including the command that they're intended to do. I'm not sure what exactly this is useful for, but it's a lot of fun!

click here to open this script in your editor
beep 2

on beep x
say "So, you want me to beep " & x & " times, eh?"
delay 3
continue beep x
end beep

on delay y
repeat y times
continue delay 1
say "hmmm"
end repeat
say "ok"
end delay

(3 comments | Leave a comment)

November 27th, 2005
09:24 pm

[Link]

Save all Safari Tabs as PDF
http://forums.macosxhints.com/showthread.php?p=250292
Are there any Applescripts that allow me to automate saving to PDF? (In particular saving all open tabs in the browser as PDF files).Read more... )

Tags: , ,

(1 comment | Leave a comment)

09:19 pm

[Link]

Internet Connect GUI Script for 802.1x
Is there a way to script a new 802.1x connection in internet connect?
http://discussions.apple.com/message.jspa?messageID=1209683
Read more... )

Tags: , ,

(Leave a comment)

02:39 pm

[Link]

Sticky Note Mail Rule
"I want to be able to email notes to a certain email address and then, when I get home and check my mail, have each of those emails turned into a brand-new sticky note on my desktop."-[info]nightbird
http://www.livejournal.com/community/applescript/20620.html?style=mine

Read more... )

(6 comments | Leave a comment)

November 18th, 2005
02:02 pm

[Link]

Detect sound activity with AppleScript
Wake display with a sound, any sound.
"how can I use the integrated microphone for to wake the screen any time a nois is detected and keep it on until a no noise is detected for a certain amount od time?"

There may be a better way to do this, but the first thing that came to my mind was VOX voice-activated recording apps. The one I test here is the shareware Audiocorder 4.5 [USD$20] you can download a demo here:
http://www.versiontracker.com/dyn/moreinfo/macosx/10417

Edit: The following script is an applet because I was originally attempting to monitor audiocorder's gui for the trigger. It seems however that the GUI is unavailable during a screensaver/display sleep event. The script in its present form could be easily written as a folder action, which would cause less performance issues.Read more... )

Tags: , , ,

(Leave a comment)

01:49 pm

[Link]

Extract text from complex web sites
Re: Web text to word
"I want to copy all the text in my current safari web page and put it into ms word."

I thought this would be a simple thing to do, and it may be simple in Word 2004, but I only have Word v.X, and everything I tried was either failing entirely, failing half the time, or producing garbled results. The only clean way I found to accomplish this task on my machine was to pass the text through both TextEdit and 10.4 Tiger's 'textutil' before opening a temporary file in Word. This isn't a particularly concise script, nor is it terribly obvious, but it works, and the results are on par with what you'd get using Word's 'paste special' feature.Read more... )

Tags: , , , , ,

(Leave a comment)

01:43 pm

[Link]

Script iChat login accounts
Re: Switching iChat Accounts
On Nov 14, 2005, at 9:36 PM, Ed McNichol wrote:
I have 15 users who share three computers. Each COMPUTER has an iChat account. I want the user logged into the iChat account appropriate for that computer. Users preferences are shared from a network log on. I would like to script this to happen at log on.

On Nov 15, 2005, at 19:08:08, Dave Lyons wrote:
I don't know how to make this work, but I got a little bit further. The dictionary indicates that "log in" takes a reference to the account to be logged in

From what I can tell this is just a case of a misleading dictionary entry. The only object I can get iChat's 'log in' command to accept is a reference to the service (AIM, Bonjour, Jabber) that is to be logged into. Accounts themselves are defined in iChat preferences, and only one can be the 'default' account for each service. Here's a script I wrote that switches between the two AIM accounts that I've set up in iChat. Perhaps you can modify this so that it's useful for your situation.Read more... )

Tags: , ,

(15 comments | Leave a comment)

01:18 pm

[Link]

Droplet to compose a Mail message with attachments
Re: Automator question regarding email
"I have managed to make an Automator application where if I drag a document onto the action - it opens a new Mail message with that document as the attachment. The action also puts the specified person's email address in the Mail message's address box. What I would like to add - is that the NAME of the document which I drag onto the Automator Application, becomes the SUBJECT line of the new Mail message." Read more... )

Here is a significantly updated and enhanced version of this script. It adds in a preference system among other things:
Read more... )

Tags: ,

(Leave a comment)

November 17th, 2005
02:47 pm

[Link]

Assign unique filenames to screen captures
Re: How could I modify this script to make the name of each file unique?

There are many ways to do this. For one, if you define a 'property' instead of a 'global' then the script will remember any variable you like for just about eternity. Between runs, between boots, you name it. The only thing that would reset the property to its default setting is re-compiling the script itself.

But giving each file a unique name is more useful, and there are as many ways to do this as there are ways to slice and dice the results of AppleScript's 'current date' command.

Here is my suggestion, it outputs files that look like this:

screen 17-Nov-2005 1.10.30 AM.pdf
screen 17-Nov-2005 1.10.40 AM.pdf
screen 17-Nov-2005 1.10.50 AM.pdf
screen 17-Nov-2005 1.11.00 AM.pdf
screen 17-Nov-2005 1.11.10 AM.pdf

Note that I tweaked your script so that it takes screenshots precisely at each 10th second of each minute. This was just an aesthetic consideration for me, feel free to omit it.
Read more... )

Tags: , , ,

(Leave a comment)

September 11th, 2005
12:39 am

[Link]

AppleScript calling LiveJournal
Here's a simple script I wrote that you can use to post directly to LiveJournal from AppleScript. This is only a small example of how you can interact with LiveJournal using AppleScript. For more information on their XML-RPC implementation and syntax, look here. Remember that AppleScript treats structs as {{|records|:within, |single|:parameters}}, and don't forget to |pipe| all your labels (which should match LJ's xml fields) to prevent scripting addition conflicts. Read more... )
x-posted

(Leave a comment)

July 17th, 2005
10:08 pm

[Link]

Upload ScreenCap 0.2
This script will take a screenshot at regular
intervals, resize it, and then upload it to a web
server.Read more... )

Tags: , ,

(Leave a comment)

10:04 pm

[Link]

Safe Delete 0.2
This script can be used as a "safe" alternative
to the standard iTunes delete command. To use
it, simply select one or more tracks in your
iTunes library that you'd like to delete, and
then run the script. The script will attempt to
delete those files after checking to see if they
appear in any of your user playlists. If a
particular track appears in one or more
playlists, the script displays a dialog box that
asks if you're certain you want to delete that
particular track. The dialog box will tell you
the name of the track, and the name of each
playlist it appears in, excluding smart
playlists and party shuffle.Read more... )

Tags: ,

(Leave a comment)

July 3rd, 2005
01:30 pm

[Link]

HyperSafari 1.0


HyperSafari is a very interesting little script that employs a lot of exotic custom handlers I've been fine-tuning over the past few days. Whereas it is most useful to me in its current form, I think most people might find parts of its code - some of which haven't been seen anywhere in a script before - inspiring.

Writing it for display on this blog greatly improved its efficiency and general orderliness. In particular I figured out some clever ways of dealing with uncertain window states in applications targeted by a GUI routine.

Click Me for a Script! )

Current Mood: pretty good
Current Music: Elliott Smith - 2:45 Am
Tags: , ,

(Leave a comment)

July 2nd, 2005
04:27 am

[Link]

Download Files Here
I'm extremely pleased to report my first-ever submission to ScriptBuilders.net! After getting some great feedback on their message boards, I was asked by the the site admin to bundle it up and smack a version number on it. It also happens to be a pretty useful script.

click me for a screenshot! )

Current Mood: pleased
Current Music: Beck - Get Real Paid
Tags: , ,

(Leave a comment)

My Website Powered by LiveJournal.com

Advertisement