• 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
A really weird problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A really weird problem


  • Subject: A really weird problem
  • From: Brian Christmas <email@hidden>
  • Date: Tue, 23 Jun 2015 11:09:19 +1000

G’day scripters

An error that occurs one every second pass of a handler that saves emails in different mail boxes has me stumped.

It occurs on the line ‘tell current application to delay 0.1’, every second time I call the handler, and the code jumps to my main loop caller, loops once, then returns to after the delay.

It says all the numbers on the first call, then it say ‘2', then ‘loop’, then executes lines I don’t want it to execute, then says ‘3’, on the second call.

Repeats and rinses.

Any sage advice for a bewildered mind, please?

Regards

Santa

on runningLoopInitializer()
say "loop"
ShanesFord's fordEvent()
my performSelector:"runningLoop:" withObject:(missing value) afterDelay:2
end runningLoopInitializer


on runningLoop:{}




Erroring code


on transferMessage(theNewMailbox)
try
# set theCounter to theCounter + 1
# say "counter " & theCounter
set p to 1
set tempReDrawTheText to false
tell application "Finder"
if not (exists process "Mail") then tell application "Mail" to launch
end tell
set p to 2
tell application "Mail" to set thenewmailboxname to name of theNewMailbox as rich text
set p to 3
on error errmsg number errnum
if errnum = -1700 then
try
tell application "Mail" to set theNewMailbox to mailbox theNewMailbox
on error
return
end try
try
tell application "Mail" to set thenewmailboxname to name of theNewMailbox as rich text
end try
else
my displayError("Mail Manager's transferMessage in AppDelegate, start of handler,  " & errmsg & " error number " & errnum & " p = " & p as text)
end if
end try
try
set p to 4
tell application "Mail"
if not (exists mailbox "* items to manually process") then
make new mailbox with properties {name:"* items to manually process"}
end if
end tell
on error errmsg number errnum
if errnum = -2763 then
try
if my runForOz then my displayError("Mail Manager's this is a mailbox error -2763 " & return & thenewmailboxname as text)
try
tell application "Mail" to set temp to (message id of my currentMailItem) as rich text
end try
end try
else
if my runForOz then my displayError("Mail Manager's MainProcessingLoops's first transferMessage  " & errmsg & " number is " & errnum as text)
end if
end try
tell application "Mail"
try
set p to 5
if my currentMailItem ≠ {} then
set theOldMailbox to mailbox of my currentMailItem
else
my returnToRunningLoop()
end if
# if theOldMailbox is "* items to manually process" then my runningLoopCaller() # return
on error
set p to 6
my returnToRunningLoop()
end try
set p to 7
try
#
# Now actually shift the email
#
set p to 8
set theTempID to message id of my currentMailItem
set p to 9
set the mailbox of my currentMailItem to theNewMailbox
set my reDrawTheText to true
set my eMailHasBeenTransferred to true
# my insertEmailTextRewriteText()
set p to 10
set y to 0
set p to 12
say 1
repeat with xx from 1 to 40
try
say 2
tell current application to delay 0.1
say 3
if ((exists (some message whose message id is theTempID)) of theOldMailbox) then
try
say 4
delete ((some message whose message id is theTempID) of theOldMailbox)
say 4.1
end try
else
say 5
exit repeat
end if
end try
say 6
end repeat
say 7


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: A really weird problem
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Requesting help to get rapid response for button state.
  • Next by Date: Re: A really weird problem
  • Previous by thread: Re: Requesting help to get rapid response for button state.
  • Next by thread: Re: A really weird problem
  • Index(es):
    • Date
    • Thread