Re: saving mails...
Re: saving mails...
- Subject: Re: saving mails...
- From: Yvan KOENIG via AppleScript-Users <email@hidden>
- Date: Tue, 19 May 2020 17:26:06 +0200
> Le 19 mai 2020 à 17:19, Axel Lüttgens via AppleScript-Users
> <email@hidden> a écrit :
>
>
>> Le 19 mai 2020 à 05:16, Jean-Christophe Helary a écrit :
>>
>> […]
>>
>> # Find email
>> set shCMD to "mdfind -onlyin " & mailFolderPath & " 'kMDItemFSName == \"" &
>> mID & ".emlx\"cd'"
>> set emlFile to do shell script shCMD with administrator privileges
>>
>>
>> Right now, the shCMD that the script gives me doesn't even work directly
>> from Terminal, even with a sudo.
>>
>> If that's a sandboxing/security feature, I'm fine with that, I'll just use a
>> different solution (also by Chris Stone), but I'd like to know that it's not
>> my system that's not working…
>
> Hello Jean-Christophe,
>
> Here, under Mojave, Script Editor (or Terminal) needs to be given full disk
> access for being able to return the file’s path. No need for "with
> administrator privileges" (or sudo) then.
>
> Axel
Hello
Jean-Christophe is aware of that.
It's because mdfind returned nothing under Catalina that I asked him to try to
add 'with administrator privileges"
I dislike to ask the same question in two locations but i break my own rule.
Here is what I posted in macScripter:
I assumed that it was a simple task but I found no clean way to get the id of
the account owning a given mailbox.
Here is what I got for a mailbox named "fournisseurs" (fournisseurs.mbox)
available on my machine.
set boxName to "fournisseurs"
tell application "Mail"
set boxProperties to properties of mailbox boxName --> {account:missing
value, name:"fournisseurs", container:account id
"30ACBF46-881C-40AC-B33B-500D53832270", class:container, unread count:0}
set boxContainer to (get container of boxProperties) --> account id
"30ACBF46-881C-40AC-B33B-500D53832270"
try
set boxID to id of boxContainer -- I assumed that it would return the id
on error errMsg -- but it doesn't
log errMsg (*Erreur dans Mail : Il est impossible d’obtenir account id
"30ACBF46-881C-40AC-B33B-500D53832270".*)
set boxID to item 2 of my decoupe(errMsg, quote)
end try
end tell
return boxID --> "30ACBF46-881C-40AC-B33B-500D53832270"
#=====
on decoupe(t, d)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item
delimiters, d}
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
#=====
I deliberately split the task in single ones.
Is it a way to get the id without relying upon an error message ?
I'm building an alternate script and I'm facing the described problem.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mardi 19
mai 2020 17:25:19
_______________________________________________
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