Set Mail Signature with Run AppleScript Action inside an Automator workflow

Hello,
Not sure if I am posting this at the right spot, but I would need some assistance. I am trying to write an Automator Workflow application. The purpose for this application is to:
1. Drag one or more attachments on the application/droplet icon
2. Automator workflow creates a new mail message in Mail with the attached items already addressed and ready to go to
I setup the following Workflow inside Automator:
1. New Mail Message
2. Add Attachments to Front Message
So this is all working just fine. Now I would like to add a step in between of type "Run AppleScript". In this "Run AppleScript" action I have the following code:
on run {input, parameters}
tell application "Mail"
set the message signature of input to signature "My Signature Name"
end tell
return input
end run
So my workflow looks now like this:
1. New Mail Message
2. Run AppleScript
3. Add Attachments to Front Message
I am getting the following error:
Can’t make «class situ» "My Signature Name" of application "Mail" into the expected type.
So, in essence I am trying to select a signature for that particular new mail message in this workflow. And that does not work. Any help would be appreciated.
Martin

first, you don't need the extra action to add attachments. if you drop some items on the saved application they will be passed to the "new Mail message" action as input and will be added as attachments. also, in my testing it seems that the processes of attaching the attachments seem to bump against the process of adding the signature. it get the same result as you originally but if I add a delay to the run applescript action then it works as it should so try
1. new mail message.
2. run applescript
on run {input, parameters}
delay 1
tell application "Mail"
set the message signature of (item 1 of input) to signature "My Signature Name"
end tell
return input
end run

Similar Messages

  • Mail signature with fortunes

    hi, everyone!
    i want to add a random signature everytime i compose a new mail. this signature should be generated with the stdout put from the good old comand line tool 'fortune'.
    i've already written an applescript that will do that but i don't want to execute the script everytime i want to write a new mail instead this should be done automatically evertime i hit compose mail.
    i didn't found a solution yet and when i search for 'random signature' they always come up with the functionality to choose a random signature of all available sigantures... a bad solution might be to create 1000 signatures
    have anyone of you an idea to realize that - with or without applescript?!
    thx

    first, you don't need the extra action to add attachments. if you drop some items on the saved application they will be passed to the "new Mail message" action as input and will be added as attachments. also, in my testing it seems that the processes of attaching the attachments seem to bump against the process of adding the signature. it get the same result as you originally but if I add a delay to the run applescript action then it works as it should so try
    1. new mail message.
    2. run applescript
    on run {input, parameters}
    delay 1
    tell application "Mail"
    set the message signature of (item 1 of input) to signature "My Signature Name"
    end tell
    return input
    end run

  • Chaining "Get Value of Variable" and "Run AppleScript" actions in Automator

    I'm attempting to access a variable I've set in Automator from within a "Run AppleScript Action". On occasion, generally when I start in a fresh new file, I can chain the "Get Value of Variable" action with the "Run AppleScript" action as you would expect.
    Most times, though, they will not chain together. I haven't specified that the "Run AppleScript" action should ignore input, but it behaves that way. I've tried everything I can think of, but I'm out of ideas.
    Am I going about this all wrong? (Thanks in advance for any suggestions!)
    Message was edited by: rch_nashville (for clarity)

    The *Get Value of Variable* action is another quirky one. I'm not sure what causes it to fail, but sometimes putting another (dummy) action in between gets it to work. You can also access workflow variables directly from the Run AppleScript action, so you might also give that a try:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 680px;
    color: #000000;
    background-color: #B5FF6C;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters} -- get values of workflow variables
    set output to {}
    set theVariables to the name of variables of front workflow
    if the result is not {} then
    set theVariables to (choose from list theVariables with multiple selections allowed and empty selection allowed)
    if result is false then error -128 -- cancel
    repeat with someVariable in theVariables
    set the end of the output to (get value of variable someVariable of front workflow)
    end repeat
    end if
    return output
    end run
    </pre>

  • Accessing multiple Automator variables in a Run Applescript action

    I have an Automator app set up with 4 variables feeding into a Run Shell Script with the following code. And it runs perfectly.
    /Applications/Adobe\ After\ Effects\ CC/aerender -sound ON -project $1 -comp "$2" -output $3/$4
    However, I need to be able to see the progress of the Script while it processes in the Terminal window. So, I'm setting up a Run AppleScript to tell Terminal to run the script, but I'm getting two problems.
    code:
    on run {input, parameters}
              set aVar to item 1 of input
              set bVar to item 2 of input
              set cVar to item 3 of input
              set dVar to item 4 of input
              tell application "Terminal"
      activate
                        do script "/Applications/Adobe\ After\ Effects\ CC/aerender -sound ON -project aVar -comp \"bVar\" -output cVar/dVar"
              end tell
    end run
    Problem 1--Either my syntax or method of setting the 4 variables to access the array of 4 input variables is wrong. And I don't know enough about AppleScript to figure it out.
    Problem 2-- AppleScript really doesn't like the spaces in "Adobe\ After\ Effects\ CC" even though the Terminal has no problem with it. But it errors out before it even gets to Terminal.
    Any help that anyone can give will be greatly appreciated.

    The backslash is also used as the escape character in an AppleScript string, so to actually get the character you need to escape it (you can also use the term quoted form of to let AppleScript figure out how to quote the string).  To use the variables, you need to use the concatentation operator to mix the variables and text pieces - by putting a variable inside the string the identifier just becomes text.
    Your string should look something like:
    "/Applications/Adobe\\ After\\ Effects\\ CC/aerender -sound ON -project " & aVar & " -comp " & bVar & " -output " & cVar & "/" & dVar
    or perhaps
    quoted form of "/Applications/Adobe After Effects CC/aerender" & " -sound ON -project " & aVar & " -comp " & bVar & " -output " & quoted form of (cVar & "/" & dVar)

  • Making mail signatures with hyperlinks

    Hi, I want to make a simple email signature which has a link to my website which the recipient can click on and my email address which when clicked launches an email.
    I can set this up via hyperlink ok. However when people reply my signature the link to our site gets messed around :
    Oliver Gray
    Director
    We've moved - new address below
    White Night Films Limited
    The Print House, 18 Ashwin Street, London, E8 3DL.
    Office : +44 (0)20 8090 9326
    Mobile : +44 (0)7976912306
    Email : [email protected]
    www.whitenightfilms.com <http://www.whitenightfilms.com> <http://www.whitenightfilms.com> <http://www.whitenightfilms.com/>
    How can I correct it?
    Also I have an iMac running 10.5.7 and I want to add hyperlinks to my mail signatures in that. How do I do it?>
    Many thanks!
    Oliver

    Hi Oliver,
    One way I understand is with this...
    http://www.apple.com/downloads/macosx/email_chat/directmail.html
    To do it yourself, IIRC you have to do it in HTML, some help here...
    http://allforces.com/2006/04/14/css-signatures/

  • MACBook Pro mail signature with logo

    Any idea how to get the apple logo on a mail signature on my macbook pro? I cannot seem to do this!!

    You can use the Mail app to add a signature and logo to any of your accounts.
    Web based email can't use signatures at this time.
    Google for instructions and the stuff you'll need to create a signature.

  • AppleScript error -609 in Automator workflow

    I created an AppleScript on one computer and incorporated it in an Automator workflow. The script works perfectly well stand-alone or as part of the workflow.
    Then I copied both files to a headless computer via VNC. I adjusted the workflow to look at the new location of the script, and the script itself to look at the new location of the file it's processing. Now, on that second computer, the script works perfectly well by itself, but I get AppleScript error -609 Connection Is Invalid if it's run from the workflow.
    For testing purposes I reduced the script to its simplest expression:
    tell application "Finder"
    end tell
    and it's still generating the error.
    Strangely, from the workflow the full script does what's it's supposed to, but the workflow stops because of the error. The error appears even if this script is alone in the workflow. Does anybody know what it means?

    That error means that the script wasn't able to communicate with the targeted application properly, which can happen if the application crashes while the script is running. If that error doesn't cause any problems, it's appearance can be suppressed:
    try
    (your code)
    on error number -609
    end try
    This construct will not execute any code on or after the line which produces the error.
    (32099)

  • Mail.app - Rule runs AppleScript, App crashes

    I have a very simple AppleScript that extracts some information from the content of a message and is eventually supposed to do something with it. However, I have hit a snag:
    I can get the data from the content and I can tell Mail to 'display dialog' with that data. That works fine the first time I run the script, but if I put in a loop to go thru multiple messages or if I simply run the script again on the same message I get a blank dialog box, a bit of whirring and Mail crashes.
    Any ideas? I suspect this is some corruption somewhere, but I am really not too sure where to start...

    I decided on the good old 'repair permissions' route after other apps started to behave strangely - crashes all over the place. Not only did that fix the stability, but Mail has started to behave as expected now.

  • Run several scripts with one master script or an automator workflow?

    I have several scripts that I need to run all at once...
    Could I make a script that would run all the other scripts, then bundle everything into an application( or something similar) so all my scripts would run with just a double click...
    Any ideas?

    Yes, this is possible. Save your master script as either an application or a script bundle (whichever is most convenient). Then, save all of your subscripts inside the bundle.
    You can then load and run the scripts from your master script. The following code does that:
    set aScriptFile to load script file (path to me as string) & "Any additional subfolders" & "Script File Name.scpt"
    run aScriptFile
    Note that "path to me" will not work properly when the script is run from within script editor. It will, however, work when run from the script menu. See the following for a discussion of that:
    http://discussions.apple.com/message.jspa?messageID=2789538

  • Automator Applications don't let me run applescripts!

    ok just made an excellent automator application that deleted invisible files on selected drives. the only problem is that when i run it as an application, it gives me an error message and tells mr to check the "Run Applescript" action's properties. But, it works in the workflow perfectly!
    please help.

    OK, that does help. The statementset y to (value of variable "path" of front workflow)uses Automator terminology - unless your workflow is actually running in Automator, your script won't know anything about those terms unless you target the Automator or the Automator Runner applications.
    In this case though, you don't need to use variables at all, since the value you want is in the input parameter of the *Run AppleScript* action (this is what is output from the previous action). Note that the input parameter is a list, so you need to repeat through the items in the list or coerce it from a list to the desired class. Your Terminal scripting also seems to be a bit severe, but with the items I noted your workflow would be something like:
    1) *Ask for Finder Items* { Type: Folders } (Allow Multiple Selections is not checked)
    2) *Run AppleScript*
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters}
    set y to input as text -- coerce from list
    display dialog "Are you sure you want to delete the Trash folder on flashdrive " & quoted form of y & "?" buttons {"Cancel", "Yes"} default button 2
    display dialog "Enter password:" default answer "password" buttons {"Cancel", "OK"} default button 2
    set x to (text returned of result)
    tell application "Terminal"
    delay 2
    do script "cd " & quoted form of POSIX path of y -- convert path
    do script "sudo rm -rf .Trashes" in window 1
    delay 2
    do script x in window 1
    delay 2
    do script "yes" in window 1
    delay 2
    do script "killall Terminal"
    end tell
    return input
    end run</pre>

  • Passing 2 Text Strings to Applescript Action

    I am trying to make a Automator Workflow that Checks if an RSS Feed has Changed & if there is a change then Tweet the New Update.
    I have managed to get the URL and Extract the Text from the feed. and limit it to just the very latest 1 Item from the feed, Then i  have 2 Variables set-up one Called OldText and Another Called NewText.
    I Need to compare the 2 Variables for any change.
    In an applescript action i tried the following
    on run {input, OldText, NewText}
              if NewText = OldText then beep
              return input
    end run
    I Get a Syntax Error
    current application, current application} doesn’t match the parameters {input, OldText, NewText } for run.
    I was using beep just for testing code will work
    can it not pass 2 variables at a time ?

    The parameters to an Automator action are already defined - you can't just put in your own.  In the case of the Run AppleScript action, the run handler is defined as:
       on run {input, parameters}
    where the input parameter is a list (even if there is only one item) of the items passed from the previous action, and the parameters parameter is a list of the user interface settings (text fields, check boxes, etc) and options of the action itself.  If you are passing items to your script from previous actions in your workflow, you can get the desired item number from the input list (e.g. item 2 of input - I am guessing that you would know the order), and to get the value of a named variable from the workflow you can just ask Automator, for example:
       set oldText to (get value of variable "oldText" of front workflow)

  • How can I create an HTML Mail signature?

    I've spent the evening searching for a way to create an HTML Mail signature with no luck.  My problem is that when I create a new signature in Mail and close mail I try the following:
    1.  Create an HTML signature in Dreamweaver CS6
    2.  Open it in Safari &amp; save it as a .webarchive to the desktop &amp; close Safari &amp; Dreamweaver
    3.  Open the signature folder (through Finder) and copy the Mail generated name (.mailsignature or it could be .signaturemail - can't remember) &amp; delete the file
    4.  Click on the .webarchive and replace the name with the .mailsignature
    5.  Copy the new .mailsignature file &amp; paste it to the signature file
    6.  Open mail and try to use the signature
    7.  NOT WORKING
    THANK YOU IN ADVANCE FOR ANY SUGGESTIONS!
    PS  I use iCloud if that makes any difference.

    This tutorial is great!
    http://mydesignpad.com/create-a-complex-html-email-signature-for-mail-on-mac-os- x-10-9-mavericks

  • How to set up SAPconnect with email server

    Hi,
    Does any one know <b>how to set up SAPconnect with email server</b>
    We are using workflow and when it fails it we are sending the notification mail to the user on his company mail id, i.e. [email protected]
    This is working in the current production system. We are doing the new development which will replace the current production system. The existing Basis team does not know how it was setup in production system and how to set it up in the new system.
    When we send any mail notification from workflow we can see the mail in SCOT transaction but it is not received at the specified mail address.
    Can any one provide the configuration steps or any document for this.
    Thanks in advance..
    Pratik

    Hi Pratik,
    Check the following link:-
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    http://help.sap.com/saphelp_nw04/helpdata/en/2b/d925bf4b8a11d1894c0000e8323c4f/frameset.htm
    these link will help u to config SMTP.
    And one more thing u have to do..
    Go to SE11 n open Table sxnodes in change mode.
    And change F_ESMTP field to false i.e. BLANK for the Field NODE = SMTP.
    Hope this will work For U.
    Regards
    Sachin Dhingra

  • Image in Mail Mail signature is pixelated. How can this be fixed?

    Hi there,
    When I create a mail signature with image (72 dpi) in Mac Mail, the sent image looks very pixelated to the recipient. When I use a higher res image (150 dpi), it looks clear but then the image is huge to the recipient. To try and solve this issue, I have created an HTML signature and image looks fine, but since I have to impletment this across a large organization, having to go in and alter everyone's mail settings is not an option.
    Does anybody know why this happens?
    Many thanks!

    If you are asking how, while creating a email message, can you switch from the current outgoing email email message and look up a previous email to reference a line to include in the outgoing email without having to "save as draft or cancel" and the go back to the email message I am creating, this is my problem too. If the is not what you meant, consider this a new topic as I did not find an answer without going 10 pages deep in "topics".
    Thanks
    SK

  • E-signature with photo goes out as an attachment

    I am very new to MacBook. I recently created e-mail signature with a photo. When an e-mail is sent to Mac, it shows the signature with a photo in the body of the text and also shows the signature as an attachment. But when the same e-mail is sent to PC, the signature with a photo shows only as an attachment. It creates a problem since recipient has to open the attachment to read the signature.
    Is there any way to send email signature with a photo not as an attachment?
    Thank you in advance for your kind assistance.

    Apple Mail encrypts messages differently than the rest of the Pack.
    It embeds Attachments into the body of the message.
    Everyone else Attaches it separate from the body.
    To comply, Mail (I think) complies with both.
    And when .Mac subscriber emails other .Mac subscriber,
    they both use Apple's system, when Gmail-er emails Yahoo-er
    or .Mac-er emails Gmail-er Mail attaches it both ways.

Maybe you are looking for