Aperture batch export AppleScript

February 3rd, 2010

While in Australia and New Zealand, I shot a ton of photos.

Normally, my photos sit on a hard drive and no one sees them. I wanted to make sure that didn’t happen this time.

First, I grouped the photos in to folders in the Finder. Then, I created a new project in Aperture and imported all of the folders as albums. Then, I went through each folder and rated the photos. If a photo was 4 or 5 stars, I deemed it good enough for flickr.

I wrote the following AppleScript to find the albums, iterate through them, and export JPEGs of all the photos I had starred.

property basePath : “harddrive:Users:me:some_photos:”

with timeout of 600 seconds
  tell application “Aperture”
    set myProject to get project “some_project”
    set myAlbums to every album of myProject whose name starts with “NZ”
    set albumCount to count items in myAlbums
    –set myAlbums to items 16 through albumCount of myAlbums
   
    repeat with currentAlbum in myAlbums
      set folderName to name of currentAlbum & ” selects”
     
      set imageList to (every image version in currentAlbum whose main rating is greater than 3)
     
      try
        tell application “Finder” to make new folder at basePath with properties {name:folderName}
      end try
     
      export imageList to basePath & folderName using export setting “JPEG – 50% of Original Size”
    end repeat
  end tell
end timeout

Privacy by Design

February 2nd, 2010

The latest CDT Policy Post discusses the importance Privacy by Design. They extensively reference Anne Cavoukian (Ontario’s kickass Privacy Commissioner and author of Who Knows).

The seven principles of Privacy by Design are:

  • Proactive, not Reactive; Preventative, not Remedial
  • Privacy as the Default
  • Privacy Embedded into Design
  • Full Functionality – Positive-Sum, not Zero-Sum
  • End-to-End Lifecycle Protection
  • Visibility and Transparency
  • Respect for User Privacy

Any system you build should take these in to account.

Good help is hard to find (or: Nancy Pelosi annexes Canada)

January 26th, 2010

I wrote Nancy Pelosi, letting her know that electronic voting machines are problematic and voter-verified paper ballots are essential.

She wrote me back:
Pelosi letter

Like her colleague Diane Feinstein, she is having trouble finding competent correspondence staff.

Note the key paragraph here:

Senator Bill Nelson (D-NB) introduced the companion Senate bill, S. 1431, on July 9th, which was referred to the Senate Committee on Rules and Administration.

NB is New Brunswick, Canada. Last time I checked, Canada was a sovereign country. Bill Nelson is the senator from Florida.

Portland: still awesome. Now with bike boxes.

December 9th, 2009

Los Angeles promotes transit. Yes, really.

December 8th, 2009

Diane Feinstein sending constituents bad info

November 22nd, 2009

As part of a letter-writing campaign, I recently asked Senator Diane Feinstein to support health care (health insurance?) reform.

The form letter I got back is simply wrong. She wrote “However, neither the Senate nor the House has adopted a single, comprehensive bill for consideration.”

The House passed “a single comprehensive bill” (HR 3962, the Affordable Health Care for America Act) on Saturday, November 7, 2009 at 11:15 PM eastern time — over a week before this letter was sent.

Here’s Feinstein’s reply in full:

From: senator@feinstein.senate.gov
Subject: U.S. Senator Dianne Feinstein responding to your message
Date: November 16, 2009 8:37:42 AM PST

Dear Mr. Schreiber:

I received your letter regarding healthcare reform, and I appreciate hearing your concerns about citizenship verification.

At this time, there is still no single healthcare reform proposal or plan. The Senate Finance Committee and Senate Committee on Health, Education, Labor, and Pensions have each passed separate bills on healthcare reform. There are also three bills that have been approved by separate committees in the House of Representatives. However, neither the Senate nor the House has adopted a single, comprehensive bill for consideration.

Both the Congress and President Obama have been explicit that health care reform should not expand coverage to undocumented immigrants. As such, all of the healthcare reform bills currently contain provisions to prohibit the undocumented from accessing the proposed subsidized or public benefits-which is consistent with current laws that do not allow undocumented immigrants to access federal healthcare programs such as Medicaid or the State Children’s Health Insurance Program.

Like you, I believe that- whatever the final bill- the verification measures in these bills should not have an adverse impact on U.S. citizens or legal immigrants in this country. It is my hope the Senate bills can be merged to achieve the goal of expanded, affordable coverage for Americans, and I will certainly be mindful of the points you raised in your letter as this process continues.

If you are interested in accessing additional information on my views on healthcare reform, I encourage you to visit the “In the Spotlight” link on the front page of my website at http://feinstein.senate.gov/. I hope you will continue to keep me informed of your opinions, and I invite you to contact my Washington, D.C. office at (202) 224-3841 if you have any questions.

Sincerely yours,
Dianne Feinstein
United States Senator

Further information about my position on issues of concern to California and the Nation are available at my website http://feinstein.senate.gov/public/. You can also receive electronic e-mail updates by subscribing to my e-mail list at http://feinstein.senate.gov/public/index.cfm?FuseAction=ENewsletterSignup.Signup.

Sixty-five more reasons to call congress

November 7th, 2009

Reposted from my daily kos diary:

A while ago, I wrote about Stories of Health, our project to document how America’s broken health care system affects us all.

On the eve of Congress’ historic health care vote, I have some more stories to share.

Since that time, we’ve continued to travel. We spent a week in Los Angeles, where we heard from folks like Nina, whose parents had to sell their house to pay their health care bills.

Thanks to the Angela and Nancy at Health Access, we had the good fortune to meet Carla and Susan, two amazing doctors at LA County hospital. If you heard what Carla told us after the camera was turned off, you’d have been as inspired as I was to know there are such amazing doctors out there. It’s incredible what they get done with such limited resources. Carla’s a primary care physician, not a specialist, and the wait to see her is three months.

Three months.

On the way back, we stopped in Bakersfield, where we met the amazing Matthew Cruise. Matthew’s a Vietnam war veteran who went on to start a microfinance NGO, Pull Up from Poverty.

Despite having insurance, Matthew’s wife is going to go to India to have her hip replacement surgery performed. Why? Because the trip to India and the cost of surgery is still cheaper than their 20% patient responsibility.

We have had the good fortune to work with Meghan Newell, a fantastic video editor who put these together:

If you need another reason to call congress here are 65 more.

Call for Grace, who lost her husband.

Tell your sister to call for Liz’s sister, who doesn’t know how she’ll pay her emergency room bills.

Have your cousin call for Steven, whose premiums have increased 107% in 30 months.

Have your best friend for Margriet, who can’t read this diary entry because she can’t afford her Glaucoma medication.

Have your Mom call for for Toni, so her children won’t go without health insurance.

Just call.

Another solution for WordPress’ “You do not have sufficient permissions to access this page.”

October 18th, 2009

Many WordPress users have run in to the error “You do not have sufficient permissions to access this page.”

Sometimes, it is because you changed the table prefix and the solution is a database change.

For other folks, it was due to old plugin incompatibility. To fix it, you need to replace admin_head with admin_menu.

Unfortunately, neither solution worked for me. However, the latter (and some digging) pointed me in the right direction.

In my case, I had to change the parameters to—and order of—the add_submenu_page() and add_menu_page() calls.

Here’s the old code:

function thgs_add_menus() {
 add_submenu_page(__FILE__, "Heather Gold Show", "Shows", 8, "thgs/shows.php");
 add_submenu_page(__FILE__, "Heather Gold Show", "Venues", 8, "thgs/venues.php");
 add_menu_page('Show Management', 'Shows', 8, __FILE__);
}

And here’s the fix, which works with WP 2.8.4:

function thgs_add_menus() {
  add_menu_page('Show Management', 'THGS', "administrator", "thgs/shows.php");
  add_submenu_page("thgs/shows.php", "Manage Shows", "Shows", "administrator", "thgs/shows.php");
  add_submenu_page("thgs/shows.php", "Manage Venues", "Venues", "administrator", "thgs/venues.php");
} 

New AirPort base station?

October 17th, 2009

The apple.com search engine seemed to have a spot of trouble with this one.
apple search fail

Designing Obama

October 1st, 2009

Scott Thomas, the design director for Obama for America (and the guy who kicked my butt every day for two months to make sure Vote for Change was as good as it could be) has put together Designing Obama.

This a fantastic book chronicling the art both from and inspired by the Obama campaign.

Here’s how Scott describes it:

The Obama presidential campaign was innovative. For the first time in American politics, a candidate used art and design to bring together the American people—capturing their voices in a visual way.

The Design Director of the Obama campaign, Scott Thomas, has collaborated with artists and designers to create Designing Obama, a chronicle of the art from the historic campaign. Get the inside story on how design was used by the campaign, and scope out the pieces, created unofficially, by grassroots supporters.

The 360-page book is full-color and hardbound, highly crafted with an embossed sleeve. Forewords written by Steven Heller and Michael Bierut.

Like the campaign, this book is relying on small contributions to fund it. It will only get made if enough preorders are in place by November 5, 2009.

Reserver your copy today.