• 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: Another 'Mail' hassle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Another 'Mail' hassle


  • Subject: re: Another 'Mail' hassle
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 26 Apr 2017 22:56:02 +1000


Here’s a greatly simplified version of the script I posted.

It accessess the saved Mail Folders of the startup disk, as I wondered if the offending command was failing because it was addressing an external source.

Still doesn’t work.

If no one thinks there’s a scripting error, I’ll lodge a bug.

Regards

Santa

property cccDisk : ""
my nowCopyInformation()

on nowCopyInformation()
try
tell application "Finder"
set (my cccDisk) to startup disk
activate
try
set p to 1
tell application "Finder"
activate
set theExternalDisk to (my cccDisk)
set folderNames to name of (folders of (folder "Users" of theExternalDisk))
repeat with eachname in folderNames
if eachname is not in {"Guest", "Shared"} then
set theExternalUser to folder eachname of (folder "Users" of theExternalDisk)
exit repeat
end if
end repeat
set theMailStorage to every folder of folder "V4" of folder "Mail" of folder "Library" of theExternalUser
set repeatExit to true
repeat with eachCheckFolder in theMailStorage
set p to 2
set eachCycleFolder to every folder of eachCheckFolder
repeat with eachFolder in eachCycleFolder
set p to 3
if (name of eachFolder as text) starts with "Year " and name extension of eachFolder is "mbox" then
set p to 4
tell application "System Events" to display dialog (name of eachFolder) as text giving up after 2
set p to 5
set eachFolder to eachFolder as alias
set p to 6
my importMail(eachFolder)
end if
end repeat
end repeat
end tell
on error errmsg
tell application "System Events" to display dialog errmsg & " p = " & p giving up after 20
end try
end tell
on error errmsg
tell application "System Events" to display dialog errmsg
end try
#
#
#
end nowCopyInformation

on importMail(eachFolder)
tell application "Mail"
activate
try
say "importing"
import Mail mailbox at eachFolder
on error errmsg
tell application "System Events" to display dialog "Import " & errmsg giving up after 20
end try
end tell
end importMail

 _______________________________________________
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

  • Prev by Date: Speeding up OmniFocus/Calendar Script
  • Next by Date: Help Please! Applescript Editor goes into tight loop
  • Previous by thread: Re: Another 'Mail' hassle
  • Next by thread: Speeding up OmniFocus/Calendar Script
  • Index(es):
    • Date
    • Thread