Reading and writing a Photoshop (PSD) file with AppleScript...

Is it possible to read the binary code of a Photoshop file using AppleScript and then say store that code in a db and pull it back at a later date, write it to a file and have Photoshop open that file?

I’m trying to build a real simple version control app for graphics.

Thanks for any help.

I’ve “read” Photoshop files using a hexdump to scan for “header” information, but never tried re-saving them to see if they still functioned. I suspect not. But someplace to start:

set hex_dump to (do shell script "hexdump -C " & this_item_posix & " | awk '{print(substr($0,62,16))}'")

In your case, dropping the “awk” is probably advised because that is just to make it human-readable. But not being a command-line guru, and having had someone help me with the above, that’s all I know.

Hi,

Why not saving the PSD file to a well structured directory (e.g. in the app’s own bundle) and have the database just handle the file path?

Saving the complete binary format of the file in the db will bloat it and in most cases it’s not necessary to save whole files in a db.

Just my 2 cents :slight_smile:

Best regards from Berlin,

Martin

Hi Martin

I did consider that the db would become huge.

But wouldn’t it make more sense (because I am in an enclosed environment) to have the structured directory on a server rather than in the app bundle, doesn’t the potential for the app bundle to become huge also exist?

After mulling this for a few days I now want to take a stab at doing something on the lines of PixelNovel’s Timeline, a PS plugin that runs on Subversion (or you can pay to have them host your files). I would imagine they are not storing the various branches of a file locally.

So…if 0 was no knowledge of building PS plugins and 10 means you’re one of the Knoll brothers I am roughly a -3…could some one point out some tutorial links on plugin development and offer any advice?

Thanks