Results 1 to 6 of 6
  1. #1


    Member Since
    Jan 30, 2009
    Posts
    48
    Applescript guru? help debug my script?
    I have this Applescript that when it runs, it is suppose to grab an image with a set name from a set location, create a new email in Entourage, place a subject line, place the image as an attachment, use my email address a the to:, and send it off to me..

    currently, I only have it correctly creating the email, adding the subject line. BUT it does not attach the image, use my email address, send it off. it just puts this half finished email into the Drafts folder.. better progress than expected... but

    where are my errors?

    on send_email(email_to) ---
    -- set email_to to someoneisomeplace.net--"
    -- set email_from to someonessomeplacek.net--"
    set image_name to "Defaultt.jpg"

    set image_path to ((path to home folder) as string) & image_name

    set image_file to image_path as alias

    tell application "Microsoft Entourage"
    activate
    set new_message to make new outgoing message with properties {subject:"Here is your proof!"}
    tell new_message
    -- set visible to true --
    -- set sender to email_from --
    make new to recipient at end of to recipients with properties {address:email_to}
    make new attachment with properties {name:image_file} at after the last paragraph
    -- activate --
    end tell
    send new_message
    end tell

    tell application "Finder"
    -- delete image_path --
    end tell
    end send_email

  2. #2

    deer dance's Avatar
    Member Since
    Jan 23, 2009
    Location
    Indiana
    Posts
    162
    Specs:
    Soon to own
    I'm not saying this to be mean, but, "Do it yourself."

    You'll never learn if you have someone else fix it for you.
    Now, if it's one little thing that you just can't figure out, then ask for help, but when you ask soemone to de-bug an entire script, it's mostly laziness.

    Proud Python Programmer/HTML Expert
    Believer in Mac OS 7

  3. #3

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    I have to agree with deer dance.

    One thing you can try is to place print commands (or the AS equivalent) after each variable to see if they really contain what you think.
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  4. #4


    Member Since
    Jan 30, 2009
    Posts
    48
    Quote Originally Posted by deer dance View Post
    I'm not saying this to be mean, but, "Do it yourself."

    You'll never learn if you have someone else fix it for you.
    Now, if it's one little thing that you just can't figure out, then ask for help, but when you ask soemone to de-bug an entire script, it's mostly laziness.
    you must be kidding? what, am I 10 years old here? I have come this far, but am stuck. if you don't want to help, no worries.. but don't waste a post telling me something like this. it adds absolutely nothing. be rest assured, I am working on debugging it still... laziness... wow, your the master of the obvious and making assumptions here

  5. #5


    Member Since
    Jan 30, 2009
    Posts
    48
    just to prove making progress.. on my own and not being lazy

    I took a different tact that is getting me closer

    set thesubject to "here is your proof!"
    set theBody to "here is your visual proof."
    set theAttachment_name to "Default.jpg"
    set theAttachment_path to ((path to home folder) as string) & theAttachment_name
    set theAttachment_file to theAttachment_path as alias

    tell application "Microsoft Entourage"
    set theRecipients to {{address:{display name:"Contact 1", address:"contact1@gmail.com"}, recipient type:to recipient}, {address:{display name:"Contact 2", address:"contact2@gmail.com"}, recipient type:cc recipient}}
    set theMessage to make new outgoing message with properties {recipient:theRecipients, subject:thesubject, content:theBody, attachment:theAttachment_file}
    open theMessage
    end tell

    tell application "Microsoft Entourage"
    send theMessage
    end tell


    now.. I have the email composed, the attachment is found in proper 'home' folder and correctly placed/attached, subject line set, contact addresses set.. so my final issue seems to be just getting the email to send. it creates and composes the email, but is waiting for it to manually be sent as it seems my final "tell" is not sending the email. I have used the Entourage script dictionary, but I am failing to see how to get the script syntax that finishes it off by sending the email.

  6. #6


    Member Since
    Jan 30, 2009
    Posts
    48
    SOLVED IT.. all by my lonesome

    On a hunch, I removed the syntax "open theMessage" and replaced it with "send theMessage" and removed the entire final 'tell' since I already had the script working with Entourage and did not need to reopen it or open the message itself.. just send it off.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VB Script to Applescript
    By John Mathews in forum OS X - Apps and Games
    Replies: 2
    Last Post: 09-02-2014, 12:52 PM
  2. Calling Perl Script From AppleScript
    By ramya_lw in forum OS X - Development and Darwin
    Replies: 6
    Last Post: 12-14-2011, 12:22 PM
  3. Applescript Help req. as script not working under 10.6.2
    By argeetee in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 03-14-2010, 05:20 AM
  4. Convert Excel VB script to Applescript?
    By pingwin77 in forum OS X - Apps and Games
    Replies: 1
    Last Post: 07-03-2008, 11:30 AM
  5. AppleScript/Script Editor Help!!!
    By JeffShawMan in forum OS X - Apps and Games
    Replies: 2
    Last Post: 05-29-2007, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •