G’day once more scripters.
I obviously don’t understand how calling scripts from one to another works.
I’m calling a script ‘MainProcessingLoops’ from my ‘AppDelegate’ script. When I need to move a mail item, I’m trying to call the ‘transferMessage’ method in ‘AppDelegate’ from ‘MainProcessingLoops’ script.
Trouble is, it’s failing, and instead referring back to the main calling ‘MainProcessingLoops’ method, with an error of ‘AppDelegate's mainLoop caller Can’t get item 1 of missing value. errnumber -1728 p = 2’.
My calling ‘MainProcessingLoops’ method is…
set {theMessageID, theCurrentMailbox, byPassPrint, RTFDName, shortRTFName, rtfdDateTimeName, printDateTimeName, barCodeDateTimeName, attachmentBarCodeDateTimeName, errorMessage, tryToSave, didItPrint} to current application's MainProcessingLoops's mainLoop:{mailManagerDesktopFolderPath, MailBoxProcessName, MailBoxStoreName, MailBoxReCycleName, ReCycleFlag, sayEveryErrorMessage, theMailManagerState, MMWorkingDate, theLastMidnight, ftpPrintFlag, serverFolder, dailyServerFolder, yearlyEmailOrdersServerFolder, didItPrint, serverBackupState, RunForOz, mainMessagesView, my DailyName}
My '‘‘MainProcessingLoops’ method is…
on transferMessage(currentMailItem, theNewMailBox) try tell application "Mail" try set currentMailItemID to message id of currentMailItem as rich text on error errmsg display dialog errmsg end try try set theCurrentMailbox to name of mailbox of currentMailItem as rich text on error errmsg display dialog errmsg end try end tell say 9 —< says ‘9' # # The relevant caller, which fails # current application's AppDelegate's transferMessage:{currentMailItemID, theCurrentMailbox, theNewMailBox}
on error errmsg display dialog "TransferMessage in mainProcessingLoops " & errmsg end try end transferMessage
My ‘transferMessage' method in ‘AppDelegate.applescript’ is…
on transferMessage:{currentMailItemID, theCurrentMailbox, theNewMailBox} say 1 — < never gets called etc
etc
I did have a lowercase ‘a’ in ‘AppDelegate’, but fixed it with TextWrangler to be sure it altered to ‘A’.
What am I doing wrong please?
Regards
Santa
|