Send E-Mail in Automator (Hidden)

Discussion in 'Mac Programming' started by Jeffrey903, May 27, 2006.

  1. Jeffrey903 macrumors member

    May 27, 2006

    I just received my new macbook pro, and am trying to create an automator workflow that will take 3 pictures, create a zip of them, and e-mail them to myself all without the user knowing. Basically, if I were to lose my laptop, the finder would login to the guest account and this workflow would automatically execute. I have successfully been able to perform the first 2 steps, but can not figure out a way to send the e-mail to myself without the finder knowing.

    I do not care how this works (automator action, terminal script, python, perl, etc), but it just needs to be transparent.

    I have been searching all over the internet and can not find a way to do this.

    If anyone knows how, I would be very appreciative.

    Thanks in advance!
  2. superbovine macrumors 68030


    Nov 7, 2003
    it would be impossible to write a script to login to a guest account unless you are login into the shell while someone is logged into the machine with access.

    the script would have to execute through permission on the account that the person logins into.

    You could probably write a shell scripts or applescript that invokes a shell command or script that uses the mail unix command to send the e-mail to yourself. you'd have to invoke the script by putting in the startup items for the account or find some other method to invoke the script. doing it this way avoids the whole finder issue, although it is still possible for someone to figure what is going on.

    Why would you need to e-mail yourself pictures if your laptop is lost? Just make a backup. This is probably for more harm than good.
  3. TurboLag macrumors member

    Feb 24, 2004
    I think you misunderstood the purpose. He would like to take a picture of who is using the stolen laptop, and have it emailed to himself.

    Sorry I cant provide a solution.
  4. HiRez macrumors 603


    Jan 6, 2004
    Western US
    I assume to positively ID the thief, and possibly be able to get some clues to their location? It's not a bad idea, although they would need to be signed onto an internet connection somewhere. You'd think anyone who steals a laptop would wipe the hard drive right away (or simply replace it), but then there's a lot of dumb thieves out there.
  5. superbovine macrumors 68030


    Nov 7, 2003
    using commercial software would better in that situation.
  6. supremedesigner macrumors 6502a


    Dec 9, 2005
    Gainesville, Fl
  7. thrustinj macrumors newbie

    Mar 9, 2007
    This is available now with iAlertU 0.25b.

    Though I haven't gotten the emails to work. I'm going to rewrite the script.

    This is the script it uses now. Is there something wrong with it?

    on send_email(email_to, email_from)
    -- set email_from to "" --
    set image_name to "iAlertU_Capture.jpg"

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

    set image_file to image_path as alias

    tell application "Mail"
    set new_message to make new outgoing message with properties {subject:"iAlertU"}
    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 {file 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

Share This Page