Like I say I have no experience with scripts…
so like this ?
– Import attachments of selected emails or formatted notes
tell application id “DNtp”
set theSelection to the selection
set tmpFolder to path to temporary items
set tmpPath to POSIX path of tmpFolder
repeat with theRecord in theSelection
if (type of theRecord is unknown and path of theRecord ends with “.eml”) or (type of the record is formatted note ) then
set theRTF to convert record theRecord to rich
try
if type of theRTF is rtfd then
set thePath to path of theRTF
set theGroup to parent 1 of theRecord
tell application “Finder”
set filelist to every file in (( POSIX file thePath) as alias )
repeat with theFile in filelist
set theAttachment to POSIX path of (theFile as string )
if theAttachment ends with “.pdf” then
– Importing skips files inside the database package,
– therefore let’s move them to a temporary folder first
set theAttachment to move (( POSIX file theAttachment) as alias ) to tmpFolder with replacing
set theAttachment to POSIX path of (theAttachment as string )
set theGroup to create location “/PDF BIJLAGEN” in (database of theRecord)
import theAttachment to theGroup
end if
end repeat
end tell
end if
end try
delete record theRTF
end if
end repeat
end tell
seems not to be working…
where do I put this script and how should I run it ?