Regarding AppleScript on Mail.app and RSS Items

Remember when I figured out to RSS items?

Well, today I tried to build a trivial little to invoke my script straight from , based on the premise that the numeric part of the filename is actually unique on filesystem tree and that it matches the message id that you can (quite trivially) obtain in a script such as:

tell application "Mail"
  -- grab the message ID
  set theSel to get selection
  repeat with theMsg in theSel
  	set theId to theMsg's message id
  	-- get Python to do the dirty work for us
  	set output to (do shell script "python ~/Scripts/emlx.py -i " & theId)
  	-- rest of AppleScript truncated for brevity
  end repeat
end tell

The idea would be that I could just invoke this from Mail Act-On and the RSS items would get properly archived.

Well, it turns out that RSS items are “special”, in the sense that fails with Mail got an error: Can’t get account "RSS".

Why? Well, reading Script Editor’s Event Log, I get:

Which means that yes, can get the actual numeric value, but apparently not assign it to anything because you’re supposed to get a complete reference (ID + mailbox + account), and cannot resolve the account bit.

Since the above is a bit ambiguous, I also tried the following:

tell application "Mail"
  set theId to id of item 1 of (selection as list)
  set output to (do shell script "python ~/Scripts/emlx.py -i " & theId)
  -- etc.
end tell

Which fails in precisely the same fashion – i.e., it is unable to figure out what the “RSS” account is.

So I just filed “#5874316”:Radar:5874316. If anyone knows a decent workaround for this (other than copying the RSS items to a “normal” folder under a “normal” account, which I really don’t want to do), I’d appreciate it if you could drop me a line.

This page is referenced in: