The Mac Observer

Unparsed


Archive for the ‘Apple’ Category || Entire Archive

AppleScript: How to Identify Files in Progress

Thursday, July 3rd, 2008

I still get an occasional AppleScript question from people who probably found my old column.  A few weeks ago Paul had a question about copying files.  He works for a TV station, and he is constantly capturing video using Final Cut Pro and dumping it into a scratch directory.  When the transfer is complete, he wants it to automatically move to a work folder.  The problem is there’s no obvious or elegant solution to tell if a file transfer is in progress, such as in a download, copying a file, or like in this case from a video camera.

After a couple of Google searches, I found this promising bit of code using fstat: 
find /Volumes -type f -name ‘*.[pP][sS][dD]‘ \! -exec sh -c “fstat {}|grep -q {}” \; -print | while read FN

Unfortunately, I couldn’t get it to work under my install of Tiger.  If you know of any unix commands or scripts that could identify a state of a file, please share them in the comments.

A pure AppleScript approach would be to use an idle handler to record the size of the item in the item’s comment field.  Every time the script runs, it would compare the recorded size to the current size, and perform an action if the size matched.  It’s a bit of a hack to rely on the comment field, especially if you’re concerned about deleting comments that may or may not already be there.  Here’s a crude script mock-up to help you get started:

on idle
tell application "Finder"
set source_folder to path to desktop folder as alias
set dest_folder to path to home folder as alias
set the item_list to list folder source_folder without invisibles
set source_folder to source_folder as string
end tell
repeat with i from 1 to number of items in the item_list
set this_item to item i of the item_list
set this_item to (source_folder & this_item) as alias
set is_folder to folder of (info for this_item)

if not is_folder then
tell application "Finder"
set FileComment to comment of this_item
set FileSize to size of this_item
end tell
try
set FileComment_num to FileComment as number
on error
set FileComment_num to 0
end try
if FileComment_num < FileSize then
tell application "Finder" to set comment of this_item to FileSize
else
tell application "Finder" to move this_item to dest_folder
end if
end if
end repeat
return 60
end idle

I found those missing iPhones!

Thursday, May 15th, 2008

At the grand opening of the Boston Apple store on Boylston St, there was only a five iPhone per person limit. Joking with an Apple employee that they must have raided the other local Apple and AT&T stores to stock enough, he replied, “Well, I don’t know anything about that!” He did say that they only had the 16GB iPhone available.

Turnout for the new store was massive, with lines spanning blocks. I arrived around 5:30pm and was able to get into the store a little after 7pm. When I left, the lines were still as long as when I first arrived. People were excited to see the biggest Apple store yet, although most excited were the store employees who cheered and high fived as people entered. They were also giving out iPod socks and T-shirts that looked like the green monster style promo Apple had up before the opening.

Every time I’ve been to the Apple store at the CambridgeSide mall, it’s always been packed to the point where browsing the store hasn’t always been fun. The new spacious store in such a convenient downtown location will be a boon to both Apple fans and the Apple curious alike. I managed to snap a few pictures during the opening. My apologies for the poor quality, I stopped by on my commute home from work and only had my cellphone on me.

Before Opening Long lines Iconic Apple

 

Apple Employees Third Floor Inside looking Out

Apple Boston T-Shirt

Open Source, a legal Jailbreaking?

Friday, March 7th, 2008

Yesterday’s iPhone SDK gave me one more reason to buy an iPhone when my current phone’s contract expires. I love discovering new software, and soon this rewarding experience will be part of the iPhone too. Developer reactions regarding the SDK are very positive overall, and it’s clear people are excited to begin working on the next cool iPhone app. Granted, many questions remain unanswered, but I don’t think that’s necessarily a bad thing. Between Apple’s Q&A and the Developer Connection, Apple has provided a solid starting point that appears reasonable for a majority of developers.

Most of the questions unanswered relate to licensing and distribution. Right now the programming process is much more important, giving developers time to experiment with the API instead of worrying about their distribution model. I’m sure some of these developers will share their idea of a perfect distribution model, and hopefully Apple will take some of these ideas into consideration. Instead of announcing a complete solution that might not work for everyone, Apple has laid out the basics to get people excited while keeping possibilities open for the numerous “what ifs” people are coming up with.

As far as technical “what ifs” go, some of the main ones are:

  • Will software need to operate differently when running on EDGE versus Wifi?
  • How in-depth will Apple review your software, and will Apple approve products competing with its services?
  • Will 3rd party software have access to the iPhone UNIX subsystem?

There will certainly be software written that Apple won’t approve. We already know functions not included in the API, the file system out of the application’s scope, and the dock connector are out. But what’s to stop the developer from publishing this “forbidden” code? Users who wanted this same unapproved feature could download the source, compile, and install the software themselves. This has some obvious limitations:

  • While the SDK is free, it costs $99 to test software on the iPhone (versus the iPhone simulator).
  • Apple may require certificates even for apps in development, thus only allowing signed applications to be tested on the iPhone.
  • Presumably, these Open Source projects are in some way using unsupported functionality, which could easily break in future iPhone updates.
  • Users who don’t want to bother with compiling code will be disappointed.
  • Would users be willing to pay for source code, or will developers be interested in releasing complex and unsupported functionality freely?

For the more ambitious user who has tinkered around with XCode, the ability to compile and install unsupported software for personal use is very appealing. While jail breaking violated terms of use, there doesn’t appear to be any legal problems in developing unsupported software. Apple won’t let you distribute the finished application to the masses, but it may be possible for other people to compile your source code on their iPhones. This is a good thing for both iPhone users and the Open Source community.

So long, and thanks for all the Lays!

Monday, January 28th, 2008

Word in the universe is that the benign floating energy ball—the power behind Crazy Apple Rumors—has up and left… just floated away. What does this mean for the site? It’ll probably go on hiatus, possibly even the dreaded Indefinite Suspension!

Longtime Mac humorists will remember As the Apple Turns (AtAT) too was fated by the Indefinite Suspension (also known as raising a child). There the site sits, looking back at us from 2005 with its Classic interface. It knows of no iPhone rebate or backdating scandal.

AtAT is of a different era where calls of Apple’s demise and doom were an everyday staple. Will Apple be bought out? Can Apple beat the Wall Street analysts? It was all great fodder just calling out to be made fun of. CARS was born out of the rumor site heyday. There was a new rumor site popping up each week. ThinkSecret was practically posting leaked press releases from Apple. Perhaps The Entity realized, with ThinkSecret closing its doors, it was time for CARS to do the same. Will humans ever understand these crazy energy beings?

It’s up to you Fake Steve, now more than ever, to give the Mac faithful their daily dose of comedy. As the Macalope can painfully tell you, analysts believe Apple is controlled by every whimsy of The All Mighty Jobs. Fake Steve, we need to know what you have in store for the entire future of the Apple brand.

Will these sites also have to fight the Indefinite Suspension one day? What new satire or comic will come along to take there place? In the meantime, if you are an energy being looking to invest in a small but growing Apple Rumors Site, please send résumé to energybeingsearchcommittee@crazyapplerumors.com. A strong passion for sexbots and experience with cyber-apocalypses a plus. Perks: Silver Cloud Inn, meals by Honoki of Roppongi, Tokyo.

Welcome!

Monday, November 5th, 2007

Welcome to Unparsed, a blog with a bit of a geeky slant that might not always contain the most polished prose.
~Stephen Swift,
Contributing Editor/Web Developer

  P.S. I’m ecstatic to have Blogs at TMO. We’re working to get these blogs publishing quicker than you can refresh the page (we enjoy ridiculously insane goals). The next step is to merge the comments with our forums so you don’t have to register twice. If you have other suggestions to make these Blogs rockin’, I’d love to hear them.

Apple Stock Quote

  • AAPL: $162.11. Change Today: -4.15.
  • (Prices delayed up to 20 minutes.)
  • Discuss in our Apple Finance Board

Hot Topics

Top Deals From DealsOnTheWeb