• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Downloading Images/Message Attachments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Downloading Images/Message Attachments


  • Subject: Re: Downloading Images/Message Attachments
  • From: Philip Aker <email@hidden>
  • Date: Wed, 4 Mar 2009 04:46:59 -0800

On 2009-03-03, at 21:15:19, Jon Rosen wrote:

Maybe I can explain this a little better. Each mail message that has graphics has a "Load Images" button if they are not set to load automatically. I want to be able to create a keyboard shortcut for that button. I could probably do that if I had an applet that could do the equivalent of pressing that button. 

I don't see that button nor a preference for it. I used to see it but can't remember if that was on 10.4 or not. In any case, as I have shown for the "Save" button (and as LuKreme suggested too), the solution is to use System Events to discover the widget and click it.

The basic discovery call for window elements in System Events is:

tell application "System Events" to tell application process "Mail"
tell window 1
every UI element
end tell
end tell

From the result of the above, by a long and boring process of going through the logical possibilities, I found that the "Save" button was located in 'group 1 of scroll area 2 of splitter group 1 of window 1'. You would do the same for the "Load Images" button.


I'm looking for a way to tell Mail to download an image attached to a message. I believe the element is Message Attachments, but there is only a r/o boolean that states whether or not it has been downloaded. There is an application-wide command to download attachments automatically, but I don't want to change that behavior. There is no menu command for it either; there is only the "Load Message" button in the message viewer window. I can't find anything in the dictionary that would allow this to be scripted. I'm only trying to do something rather pedestrian. I want to assign a keyboard shortcut that will allow me to load an image via keyboard command instead of having to click the button. Any suggestions?


You can set a shortcut key combination for the "Save Attachments…" menu item in Mail by using System Preferences->Keyboard & Mouse->Keyboard Shortcuts.

However I think you mean something like the following -- which should take you to clicking the button to save attachments. I'm using Mac OS X 10.5.6

--tell application "Mail" to activate
tell application "System Events" to tell application process "Mail"
set frontmost to true
tell window 1
tell splitter group 2 to tell scroll area 2 to tell group 1
click pop up button "Save"
end tell
end tell
end tell


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Downloading Images/Message Attachments (From: Jon Rosen <email@hidden>)
 >Re: Downloading Images/Message Attachments (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Save as PDF File for Microsoft Word
  • Next by Date: Safari Download Folder?
  • Previous by thread: Re: Downloading Images/Message Attachments
  • Next by thread: Save as PDF File for Microsoft Word
  • Index(es):
    • Date
    • Thread