Wait! I spoke to soon! :-(
I’m trying to send an email with attachment for every file I put in a
directory with Mailplane 3.
This is the script, when I add files it runs but nothing happens:
*on* *adding folder items to* thefolder after receiving theAddedItems
*repeat* *with* eachitem *in* theAddedItems
*tell* *application* "Mailplane 3"
*set* m *to* *make* new *outgoing message* with properties {directlySend:
*false*, optimizeAttachments:*true*}
*tell* m
*set* sender *to* “[email protected]”
*set* r *to* *make* new *to recipient* at *end*
*tell* r
*set* address *to* “[email protected]”
*set* name *to* "Ruben"
*end* *tell*
*set* r *to* *make* new *cc recipient* at *end*
*tell* r
*set* address *to* “[email protected]"
*set* name *to* "Lars"
*end* *tell*
*set* subject *to* “This is a test!“
*set* content *to* “This is the body text!"
#the next commented line works:
#make new mail attachment with properties {path:”Macintosh
SSD:Users:myuser:Desktop:file.pdf"} at after the last paragraph
#this active line doesn’t… if I comment this line too the script works
(without attachments of course)
*make* new *attachment* with properties {file name:eachitem *as* *alias*} at
*after* *the* *last* *paragraph*
*end* *tell*
*compose* m
*end* *tell*
*end* *repeat*
*end* *adding folder items to*
Lorenzo G.
FooLab
2016-02-24 20:13 GMT+01:00 Mailplane Support <[email protected]>:
> Awesome, glad you got it sorted out!
>
> Cheers!
>
> On Wed, Feb 24, 2016 at 1:25 PM, FooLab <[email protected]> wrote:
>
>> Solved adding “as alias”!
>>
>> make new mail attachment with properties {path:”Macintosh
>> SSD:Users:myuser:Desktop:image.jpg" *as alias*}
>>
>> Lorenzo G.
>> FooLab
>>
>> 2016-02-24 19:20 GMT+01:00 FooLab <[email protected]>:
>>
>>> Ok it works thank you Lars.
>>>
>>> Now I have another problem, I can’t attach a file to the mail. It give
>>> me an error “0 bytes” like it can’t find the file when I’m sure the path is
>>> correct, example:
>>>
>>> *make new mail attachment with properties {path:"Macintosh
>>> SSD:Users:myuser:Desktop:image.jpg"}*
>>>
>>> What’s wrong with that?
>>>
>>> If I try this it give me *YES* as return:
>>>
>>> *set* msg *to* "no"
>>>
>>> *tell* *application* "Finder"
>>>
>>> *if* *exists* *file* "*Macintosh SSD:Users:myuser:Desktop:image.jpg*"
>>> *then*
>>>
>>> *set* msg *to* "yes"
>>>
>>> *end* *if*
>>>
>>> *end* *tell*
>>>
>>>
>>> *display dialog* msg
>>>
>>>
>>> p.s. I promise that when the script will works correctly I’m going to
>>> share it with others Mailplane users. ;)
>>>
>>> Lorenzo Godio
>>> FooLab
>>>
>>> 2016-02-24 15:00 GMT+01:00 <[email protected]>:
>>>
>>>> Hi,
>>>>
>>>> Have you already tried to set the sender in AppleScript? (e.g. set
>>>> sender to "[email protected]")
>>>>
>>>> Best regards,
>>>> Lars
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "mailplaneapp" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at https://groups.google.com/group/mailplaneapp.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "mailplaneapp" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/mailplaneapp.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mailplaneapp" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/mailplaneapp.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"mailplaneapp" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mailplaneapp.
For more options, visit https://groups.google.com/d/optout.