20 April 2007
28 February 2007
Apple Events with Ruby
Matt Neuberg introduces rb-appscript in this MacDevCenter article. which allows ruby code to use AppleScript like commands to send Apple Events to other applications. In simpler words, use ruby like AppleScript.
Interesting... one of these "have to try this when I have time" things.
Interesting... one of these "have to try this when I have time" things.
16 January 2007
Remote man pages
Great hint on Extra Pepperoni: Remote ‘
If you want to use this with SubEthaEdit instead of BBEdit then do
or with the built-in TextEdit
man’ with BBEdit. Very powerful tool, not only when you work with other Unix systems. Mac OS X Server has some extra tools and man pages that are not available on the 'normal' Mac OS X installation.If you want to use this with SubEthaEdit instead of BBEdit then do
ssh $1 man $2 | col -b | see -t "$2@$1"
or with the built-in TextEdit
ssh $1 man $2 | col -b | open -f
11 January 2007
04 December 2006
No Vista Service Packs...
Ballmer: Vista to Spur 'Wave of Innovation'
Asked about the timeline for Vista service packs, Ballmer quipped that as it is the highest-quality, most secure and reliable Windows operating system ever, there should be no need for a service pack.
I'll be back when I catch my breath again... seriously.
17 November 2006
Google Earth KML Date Formatting
I am just building stuff using Google Earth, especially the new time stamped stuff. Very nice, really.
However GE expects dates in the format
and there you go. Nevertheless GE still choked on my formatted dates:
Well here is the solution:
However GE expects dates in the format
2006-11-17 which isn't so bad in itself. It's AppleScript's fault that it is a pain to format dates other than the system's preset. You just do aset dateString to (year of theDate) & "-" & (month of theDate as number) & "-" & (day of theDate)
and there you go. Nevertheless GE still choked on my formatted dates:
2006-9-5 can't be parsed by Google Earth. The leading 0 is mandatory!? WTF!?Well here is the solution:
on format_date(theDate)
tell theDate
set y to year as string
set m to (month of theDate as number) as string
if (count of m) is 1 then set m to "0" & m
set d to day as string
if (count of d) is 1 then set d to "0" & d
end tell
return y & "-" & m & "-" & d
end format_date
Script Friday: Keynote Slide Sets
I do a lot of presentations. I put together various slide decks on the different topics and then depending on the event, customer and time available I skip and reveal a different subset of slides. If I want to keep track of which slides I showed where then all I can do is have multiple copies of the same Keynote Presentation. Which is a pain, because say I want to change the content of one slide from say "October 2006" to "November 2006" then I have to remember which copy is the most current or do the change in all copies.
Wouldn't it be great if I could store multiple slide sets in one Keynote Presentation?
Keynote 3 introduced AppleScript support. Though the implementation is... er... special, it is surprisingly adept to this task.
Use the notes area of the slide to store the skipped/shown status of a slide. Decide on a name for your slide set. For Slides that should be shown in this Slide Set add a line with <Slide Set Name> to the notes. For slides that should be skipped add <Slide Set Name skip>. Obviously if your name ends in "skip", you're in deep trouble. I used the <> as markers, change the scripts if that bothers you. If a slide has neither in its notes the script will leave it unchanged. This way you can have different slide sets for different topics and the won't affect each other.
Then show all slides (or change the skip/hide setting of slides in some weird way) run this script, enter the name of the set and enjoy.
Restore Slide Set
Ok, so this manually setting the markers in slides will get tiresome really quickly. So I wrote a script to store the current slide set, run it, give a name for your slide set... wonderful.
WARNING: the way AppleScript (or specifically Keynote's implementation) handles the notes field means that when the script has to change the notes field ALL rich text formatting will be lost... :( If you don't like that, you will have to add the markers manually.
Save Slide Set
If you are bored of a certain Slide Set, you can remove the markers again:
Remove Slide Set Tags
This opens up a whole bunch of possibilities. You could have one Slide Deck with three slide sets, one for 25 minutes, one for 50 minutes and one for 100 minutes. Let's call them "Hurry Up!", "Standard" and "Detailed". Now before a presentation you could choose the proper slide set and go. However we all know how these things go. Sometimes you get a lot of questions on a certain topic and you would actually like to be able to dig deeper into this. So you could drop out of presentation mode, change the slide set to detailed and continue. Then after you are done with this topic you switch to the "Hurry Up!" set to make up for lost time. To make this easier, use "pre-canned" scripts with the marker name built-in.
Standard Set
I use Salling Clicker to switch on-the-fly, in presentation mode using the cell to execute these scripts. Unfortunately Keynote doesn't allow you to modify slides in the background using AppleScript, so the scripts will actually drop presentation mode, do their stuff, then resume presentation mode. It is a brief but ugly flash of your desktop on the screen. However I think the pay off is worth it. You should be able to assign these scripts to a HotKey Manager or other way of executing them, I leave that as an exercise for the reader.
Please let me know how you use these.
Wouldn't it be great if I could store multiple slide sets in one Keynote Presentation?
Keynote 3 introduced AppleScript support. Though the implementation is... er... special, it is surprisingly adept to this task.
Use the notes area of the slide to store the skipped/shown status of a slide. Decide on a name for your slide set. For Slides that should be shown in this Slide Set add a line with <Slide Set Name> to the notes. For slides that should be skipped add <Slide Set Name skip>. Obviously if your name ends in "skip", you're in deep trouble. I used the <> as markers, change the scripts if that bothers you. If a slide has neither in its notes the script will leave it unchanged. This way you can have different slide sets for different topics and the won't affect each other.
Then show all slides (or change the skip/hide setting of slides in some weird way) run this script, enter the name of the set and enjoy.
Restore Slide Set
Ok, so this manually setting the markers in slides will get tiresome really quickly. So I wrote a script to store the current slide set, run it, give a name for your slide set... wonderful.
WARNING: the way AppleScript (or specifically Keynote's implementation) handles the notes field means that when the script has to change the notes field ALL rich text formatting will be lost... :( If you don't like that, you will have to add the markers manually.
Save Slide Set
If you are bored of a certain Slide Set, you can remove the markers again:
Remove Slide Set Tags
This opens up a whole bunch of possibilities. You could have one Slide Deck with three slide sets, one for 25 minutes, one for 50 minutes and one for 100 minutes. Let's call them "Hurry Up!", "Standard" and "Detailed". Now before a presentation you could choose the proper slide set and go. However we all know how these things go. Sometimes you get a lot of questions on a certain topic and you would actually like to be able to dig deeper into this. So you could drop out of presentation mode, change the slide set to detailed and continue. Then after you are done with this topic you switch to the "Hurry Up!" set to make up for lost time. To make this easier, use "pre-canned" scripts with the marker name built-in.
Standard Set
I use Salling Clicker to switch on-the-fly, in presentation mode using the cell to execute these scripts. Unfortunately Keynote doesn't allow you to modify slides in the background using AppleScript, so the scripts will actually drop presentation mode, do their stuff, then resume presentation mode. It is a brief but ugly flash of your desktop on the screen. However I think the pay off is worth it. You should be able to assign these scripts to a HotKey Manager or other way of executing them, I leave that as an exercise for the reader.
Please let me know how you use these.
Subscribe to:
Posts (Atom)