Topic “Base64”

AppleScript, XML-RPC, Base64

The XML-RPC calls work as described by the documentation and examples, but they make no mention of what to do if you need to send Base64 dataFor a while it looked like I might actually be able to consolidate my current Rube Goldberg iPhoto to Movable Type solution into a single AppleScript, thanks to OS X's AppleScript Support for Remote Procedure Calls.

The XML-RPC calls work as described by the documentation and examples, but they make no mention of what to do if you need to send Base64 data; in my own tests of the Movable Type metaWeblog.newMediaObject method, a base64 encoded string simply gets handled as a plain text string on the other side, and gets written directly to the file.

On a hunch I tried passing the raw file data as an AppleScript data variable, hoping against hope that the Apple Event handler would take care of the encoding on the fly, but as far as I can tell the raw data also gets passed along as a string, leading to a munged XML-RPC message.

And naturally, there's absolutely nothing out there on the web or usenet regarding this issue... I can't believe I'm the first person to try this, but perhaps those before me have given up in disgust before getting as far as writing about it.

I dropped the good folks at developer.apple.com a note regarding the documentation, politely suggesting that some clarification would be very helpful.. we'll see what happens.

In the meantime, I may as well make the XML-RPC call via PHP with a do shell script statement.

If anyone who comes across this has a solution, I would be most grateful if you could drop me a line with a quick code snippet.

Syndicate content
Syndicate content

Twitter

  • New post: Feeding the Bow Tie Habit http://tinyurl.com/yaewh8r 4 years 30 weeks ago
  • You wouldn't think so, but speed skating is kind of boring compared to curling. #fb 4 years 31 weeks ago
  • "The problem with quotes on the Internet is they're usually sourced improperly." - Abraham Lincoln (via @prouty) #fb 4 years 31 weeks ago
  • RT @nquabbinlodge: 26th District Lodge of Instruction is at NQL tonight! Potluck supper at 6:30, instruction at 7:00, speaker at 7:30. 4 years 31 weeks ago
  • New post: Camptown Hornpipe: Minstrel Banjo Tablature http://tinyurl.com/y93tdhd 4 years 31 weeks ago

Older

Contact

Andy Chase
(978) 297-6402
andychase [at] gmail.com
GPG/PGP Public Key