Hallelujah!

Sanity prevails over Cupertino:

To Our Developers:

We have decided to drop the non-disclosure agreement (NDA) for released iPhone software.

We put the NDA in place because the iPhone OS includes many Apple inventions and innovations that we would like to protect, so that others don’t steal our work. It has happened before. While we have filed for hundreds of patents on iPhone technology, the NDA added yet another level of protection. We put it in place as one more way to help protect the iPhone from being ripped off by others.

However, the NDA has created too much of a burden on developers, authors and others interested in helping further the iPhone’s success, so we are dropping it for released software. Developers will receive a new agreement without an NDA covering released software within a week or so. Please note that unreleased software and features will remain under NDA until they are released.

Thanks to everyone who provided us constructive feedback on this matter.

I suppose this is where I mention that I am now a registered iPhone developer. More news on that later on.

AppleScript to rename files revisited

A couple years back I blogged a script that would take a file and append the name of the enclosing folder to the beginning of the file name. For example, a file called “Testfile.txt” inside a folder called “Folderstuff” would be renamed to “Folderstuff Testfile.txt.”

A reader recently stumbled across that script and asked:

That script is exactly what I’ve been looking for, with one exception:

When saved as an application I can’t drag and drop multiple files onto it. In fact, it doesn’t seem to be able to handle multiple files at all, I just get errors.

I’ve done a bunch of searching on how to deal with multiple files but I just cant seem to make it work.

Here are some updated versions of the original script. This first one is meant to be run directly out of Script Editor on whatever files you have selected in the Finder.


tell application "Finder"
set theFiles to selection
set theCount to number of items in theFiles
repeat with i from 1 to theCount
set theFile to (item i of theFiles as text)
set TheName to name of (theFile as alias)
set thePath to POSIX path of (theFile as alias)
set parentFolderPath to text 1 thru ((offset of TheName in thePath) - 2) of
thePath
set AppleScript's text item delimiters to "/"
set parentFolder to (item -1 of text items of parentFolderPath) as string
set NewName to (parentFolder & " " & TheName)
set name of file theFile to NewName
end repeat
end tell

And this version is meant to be saved as an AppleScript applet. Drop some files (not a folder on it) and it’ll run with it.


on open theFiles
set theCount to number of items in theFiles
repeat with i from 1 to theCount
tell application "Finder"
set theFile to (item i of theFiles as text)
set TheName to name of (theFile as alias)
set thePath to POSIX path of (theFile as alias)
set parentFolderPath to text 1 thru ((offset of TheName in thePath) - 2)
of thePath
set AppleScript's text item delimiters to "/"
set parentFolder to (item -1 of text items of parentFolderPath) as string
set NewName to (parentFolder & " " & TheName)
set name of file theFile to NewName
end tell
end repeat
end open

UPDATE 2008-06-13: Reader Andrew pointed out that the script only grabs the title of the front window and won’t work if you’re in list view and have a expansion triangle open. I’ve updated the scripts to account for that.

Pulling the iPhone trigger

CKB iPhoneSeven days after my 16GB iPhone arrived, my gut reaction from last July still stands. To me the iPhone feels more like a piece of high-end test equipment or something from the glory days of HP’s calculator design studio than the flimsy plastic phones I’ve had over the years. Sure there will be a 3G model in a few months, but that final “push me over the edge” purchasing moment wasn’t solely the release of the SDK, but a aggregation of things: the SDK, the big iPhone seminar track at WWDC, all the excitement among developers I respect. I’m certainly not enough of a developer to be on the 2.0 beta fast track, but I did conclude that’s it’s kinda important for me to get up to speed on it. Not because it’s a phone or an iPod Touch or whatever the hell Apple comes up with, but mainly because it’s the first new Apple OS since OS X and I believe that most of the interesting new development stuff is going to happen on it rather than on OS X. At least until Lion or whatever cat 10.6 ends up being.

Some notes so far:

  • The only way I could get AT&T to transfer my mobile number from T-Mobile was if I contracted under AT&T’s pre-paid GoPhone plan. AT&T couldn’t give me a satisfactory answer and suggested that I switch to a regular plan later.
  • I’ve barely used my iPod since getting the phone. Using it now feels like going back to OS 7 on a Mac Plus. My observation last year about “eventually all small devices like this are going to work this way” is apparently still holding.
  • Sound quality is substantially better on the iPhone than on my 5G iPod, even when holding earphone variables constant.
  • Mobile Safari is pretty handy, but I appreciate mobile-browser optimized web sites much more. If anything, they’re less cluttered and rarely have advertisements.

The iPhone “holy crap!” moment

I figured that would be a couple months and/or the release of Leopard before we would begin seeing some truly impressive uses of the iPhone. Er… try a week and a half. Telekinesis is a remote access app for the iPhone. It’s a super early alpha release, but, well… holy crap! This make my wish for a iPhone terminal app somewhat redundant.

iphone_telekinesisremote.jpg
Photo via tonx on Flickr.

Would you like to play a game?

Following on from the previous post about hobby World War III, I have to admit that WarGames is one of the few things I consider to be capital-GS Geek Scripture. I can’t think of anything more custom designed (computer hacking, nuclear war, Ally Sheedy, cranky scientist hermit, pranking the government, victory via brains instead of strength) to laser beam into my 18 year old reptile brain. Certainly meant much more to me in 1983 than the end of Star Wars.

Anyway, I’ve always wanted to play Global Thermonuclear War and twenty-four years later, I finally can. Thanks for the port Ambrosia Software. It’s the first game that’s held my attention since the days of Diablo II and can be relatively quick enough to play during a lunch break from work.

Here’s a screenshot (it’s the Big Board!) for Jonson, as South America is about to get pounded by the Imperialist Yanqui Pig-Dogs.

DEFCON

Encoding geotags in pictures

Finally, it appears that we’re closing in on a universal (a.k.a. GPS-optional) solution to embed geographic information in photo EXIF tags. It’s courtesy of the oddly named HoudahGeo which can read in GPS track files or bring up a Google Map chooser and then write out the proper EXIF tags into the files. I have hundreds of photos that I’ve scanned that have no geotags and I want to be able to embed the tags directly in the photos instead of relying on Flickr’s after-the-fact geocoding tools.

Of course, there’s the usual caveats. You have to insert the tags before you import the photos into your iPhoto library and if you want Flickr to recognize your EXIF location data you need to change your Flickr permission settings. But even with the early beta 4 of HoudahGeo, it worked!

And remember, if you go to the Sierra Vista swap meet, leave your sidearms at home.

No sidearms at the Sierra Vista swap meet

One more phone post

I couldn’t let this screamingly hilarious quote from Cingular exec Glenn Lurie go by without comment…

While “there are bad guys out there that unlock phones,” Lurie said, Apple and Cingular are taking unspecified steps to make the phone more difficult to unlock and use on other GSM carriers in the US.

Bad guys like, oh, Nokia who sell unlocked phones directly. I’m still convinced that in the medium-to-long term Cingular will end up being the overall loser.