GUI scripting Mail.app -- need help

I’ve written a script to burst MIME digests in Mail.app. Unfortunately I need help to do the GUI scripting that will automate the import of the mbox file. I can’t seem to click on the “Other” radio button.

Here’s what I’ve got so far.


set importPath to (path to temporary items folder from user domain) -- as string

-- check to see if assistive devices is enabled
tell application "System Events"
	set UI_enabled to UI elements enabled
	
	if UI_enabled then
		tell process "Mail"
			tell menu bar 1
				click menu item "Import Mailboxes." of menu "File"
			end tell
			delay 1
			tell window "Import"
				click radio button "Other" of radio group 1 of group 1
				
				--find some way to set the path to importPath
				
				click button "Choose"
				click button "Continue"
				delay 30
				click button "Done"
			end tell
			
		end tell
	end if
end tell

I’m beginning to think that this isn’t possible. Any help is appreciated.

Andy

OK, I’m replying to my own post. I managed, with some help and an epiphany, to get the ‘import Mail mailboxes…’ syntax to work.

This means 2 things.

  1. I don’t need the solution to the above problem, though I still don’t know why it didn’t/doesn’t work.

  2. I have a fully functioning AppleScript that will burst a MIME message digest and import the messages into Mail.app.

Any takers?