G’day scripters
In my app I have a pop-up button that contains a list of received emails, and each lines entry contains four items; the emails sender, the emails subject, the mailbox name it’s stored in, and the message id of the email.
It works fine until I actually process an email that does not require printing any attachments, then clicking the button sends the cursor into a spinning pizza wheel, forever, and freezes the app. The actual printing involves handing over to a separate application, which reads the parameters from a desktop file, and closes down after printing.
My code is below, but I don’t think it’s getting called.
Any thoughts on what’s going on, please?
Regards
Santa
on oldEmailListRetriever:sender try if my runForOz then say "called" set p to 1 # ShanesFord's fordEvent() set foundMessage to false set theSel to sender's title() as text set shortSearch to false if "* items to manually process" is in theSel then set shortSearch to true set theOffSet to (offset of "Ω" in theSel) + 2 set p to 2 set theMessage to characters theOffSet through -1 of theSel as text set p to 3 tell application "Mail" if shortSearch then tell mailbox "* items to manually process" try open (first message whose message id is theMessage) set foundMessage to true end try end tell end if set p to 4 if not foundMessage then set localMailboxes to every mailbox set p to 5 repeat with eachMailbox in reverse of localMailboxes set p to 6 tell eachMailbox try open (first message whose message id is theMessage) set foundMessage to true exit repeat end try end tell end repeat end if set p to 7 if not foundMessage then my sayTheText:("That message must have been trashed") else tell application "Mail" to activate end if set p to 8 end tell on error errmsg number errnum if errnum ≠ -1700 then tell application "System Events" to display dialog "oldEmailListRetriever " & errmsg & " number " & errnum & " p = " & p giving up after 40 end try end oldEmailListRetriever:
|