Hey Ruben,
this is what i have. it runs opens a new message in mailplane, but
unfortunately mailplane crashes before any attachment starts to load.
any ideas?
first action:
on run {input, parameters}
set output to "Document_Attachment"
tell application "Preview"
get (path of document 1)
end tell
return output
end run
2nd action:
on run {input, parameters}
tell application "Mailplane"
set m to make new outgoing message with properties
{directlySend:false, optimizeAttachments:true}
tell m
make new mail attachment with properties
{path:"Document_Attachment"}
end tell
compose m
return input
end tell
end run
On Nov 8, 1:10 am, Ruben Bakker <[email protected]> wrote:
> The output of the first action can be used as the input of the next action:
> In the first action I've create a variable named "output" which is returned.
>
> *on* *run* {input, parameters}
>
> *set* output *to* ""
>
> *tell* application "Preview"
>
> *set* output *to* (path *of* *first* document)
>
> *end* *tell*
>
> *return* output
>
> *end* *run*
>
> *
> *
>
> *In the second action, you can access the value return in the first action
> by using the "input" argument:*
>
> *
> *
>
> **
> *
>
> on run {input, parameters}
>
> tell application "Mailplane"
>
> set m to make new outgoing message with properties {directlySend:false,
> optimizeAttachments:true}
>
> tell m
>
> make new mail attachment with properties {path:input}
>
> end tell
>
> compose m
>
> end tell
>
> return input
>
> end run
>
> *
>
>
>
>
>
> On Mon, Nov 8, 2010 at 2:53 AM, tonkadu <[email protected]> wrote:
> > Okay Ruben,
>
> > how does this sound (see below)? i've created a workflow as a service
> > with two actions. action 1 works and the results returned are
> > correct. action 2 works but has no attachment. what i can't figure
> > out is how to get the path for the attachment in action 2 = result of
> > action 1. do you have any ideas here?
>
> > action 1
>
> > tell application "Preview"
> > get name of document 1
> > get (path of document 1)
> > end tell
>
> > action 2
>
> > tell application "Mailplane"
> > set m to make new outgoing message with properties
> > {directlySend:false, optimizeAttachments:true}
> > tell m
> > make new mail attachment with properties {path:"previous
> > result"}
> > end tell
> > compose m
> > end tell
>
> > On Nov 7, 2:55 pm, tonkadu <[email protected]> wrote:
> > > Thanks a lot Ruben. I'm trying to take your advice, but I must say I
> > > have very little experience writing in apple script or working in
> > > automator.
>
> > > so far i have created an automator workflow as a service. my settings
> > > thus far are:
>
> > > service receives selected PDF files in Preview
> > > borrowing from your other help page, i've used the run apple script
> > > event with the following in it:
>
> > > tell application "Mailplane"
> > > set m to make new outgoing message with properties
> > > {directlySend:false, optimizeAttachments:true}
> > > tell m
> > > make new mail attachment with properties {path:"Macintosh
> > > HD:Users:ruben:Desktop:china.png"}
> > > end tell
> > > compose m
> > > end tell
>
> > > what i don't know how to do is tell m to make a new mail attachment
> > > with the PDF that is open in preview. obviously the pathway for the
> > > file above is wrong as it was just your example. can you give me any
> > > hints?
>
> > > Thanks.
>
> > > On Nov 4, 6:48 am, Ruben Bakker <[email protected]> wrote:
>
> > > > Unfortunately, the Preview menu item is hard coded to use Mail.app.
> > > > Mailplane cannot change it, only Apple can do it :)
>
> > > > To streamline your workflow, you could create an Automator workflow as
> > a
> > > > service (to get the keyboard shortcut):
> > > > - Tell Preview.app to save changes
> > > > - Get filename from Preview.app
> > > > - Tell Mailplane to compose a new message with the PDF as an
> > attachment.
>
> > > > More info:
> >http://mailplaneapp.com/howto/entry/compose_email_using_applescript/
>
> > > > Hope this helps.
> > > > Kind regards,
>
> > > > On Tue, Nov 2, 2010 at 12:30 AM, tonkadu <[email protected]>
> > wrote:
> > > > > when using preview to view a pdf document in the file menu there is a
> > > > > command named "mail selected pdf document". this command only seems
> > > > > to use mail.app, and won't use mailplane even when i use the
> > mailplane
> > > > > pref to make mailplane the default mail app. is there anyway to get
> > > > > this command to apply to mailplane?
>
> > > > > also, i understand that some folks may find it easy enough to use the
> > > > > print --> save as --> Mail PDF with Mailplane command does not solve
> > > > > this problem for me. it doesn't really replace that functionality
> > > > > because it forces you to use multiple keystrokes. the allure of that
> > > > > built in preview command for me is the fact that you can execute with
> > > > > the keyboard in one swipe. note, i have tried to assign a keystroke
> > > > > to the print --> save as --> Mail PDF with Mailplane, but it doesn't
> > > > > really work, you still have to click on the "save as" drop down
> > button
> > > > > in order the keystroke to register, defeating the purpose of the
> > > > > keyboard shortcut assignment in the process.
>
> > > > > if anyone has any ideas on how to get this working it would be most
> > > > > appreciated.
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > > "mailplaneapp" group.
> > > > > To post to this group, send email to [email protected].
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<mailplaneapp%2bunsubscr...@google
> > > > > groups.com>
> > <mailplaneapp%2bunsubscr...@google groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/mailplaneapp?hl=en.
>
> > > > Ruben Bakker // uncomplex gmbh // Switzerland // mailplaneapp.com //
> > > > twitter <http://www.twitter.com/Mailplane>
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "mailplaneapp" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<mailplaneapp%2bunsubscr...@google
> > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/mailplaneapp?hl=en.
>
> Ruben Bakker // uncomplex gmbh // Switzerland // mailplaneapp.com //
> twitter <http://www.twitter.com/Mailplane>
--
You received this message because you are subscribed to the Google Groups
"mailplaneapp" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/mailplaneapp?hl=en.