How can I use Automator to extract information from the body of an email sent from a web form.. and the import it into Highrise?

I'm assuming that Automator is the way to go. I've never used it before but from research it seems to be the way to go. Also, I'm not good at programming at all.
Here's a typical email...
From:      [email protected]
     Subject:      Enquiry for Property ID: 408777039, 2 Grey Avenue, Manningham, SA 5086, Listing Agent
     Date:      18 September 2013 8:33:51 PM ACST
     To:      Joe Jope
     Reply-To:   [email protected]
You have received a new lead from realestate.com.au for
Property id: 408587036
Property address: 2 Grey Avenue, Manningham, SA 5086
Property URL: www.realestate.com.au/404387039
User Details:
Name: John Bon Jovi
Email: [email protected]
Phone: 0422645633
I would like to: buy this house
Comments: Please give me a call.
I have several hundred of these emails and I want to extract the information and then save it into my CRM which is Highrise (https://highrisehq.com). If it's too difficult to get it directly into Highrise then I'm aslo happy to extract the info into excel and the import into Highrise. However I do not want to have to run through that proceedure for every single email.
I'd really like some help on how to get Automator to do this for me. Or if not Automator.. any other suggestions?
Thanks.
John

Hello
You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
if f ends with "/" then set f to f's text 1 thru -2
do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
use strict;
use open IN => ':crlf';
chdir $ARGV[0] or die qq($!);
local $/ = qq(\\0);
my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
local $/ = qq(\\n);
#     CSV spec
#     - record separator is CRLF
#     - field separator is comma
#     - every field is quoted
#     - text encoding is UTF-8
local $\\ = qq(\\015\\012);    # CRLF
local $, = qq(,);            # COMMA
# print column header row
my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
# print data row per each file
while (@ff) {
    my $f = shift @ff;    # file path
    if ( ! open(IN, '<', $f) ) {
        warn qq(Failed to open $f: $!);
        next;
    $f =~ s%^.*/%%og;    # file name
    @dd = ('', $f, '', '', '', '');
    while (<IN>) {
        chomp;
        $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
        ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
        ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
        ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
        ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
        last unless grep { /^$/ } @dd;
    close IN;
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
EOF
Hope this may help,
H

Similar Messages

  • How can I use Automator to extract specific Data from a text file?

    I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
    How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
    Example of File Contents:
    Link Time =
    DD/MMM/YYYY
    Random
    Text
    161 179
    bytes of CODE    memory (+                68 range fill )
    16 789
    bytes of DATA    memory (+    59 absolute )
    1 875
    bytes of XDATA   memory (+ 1 855 absolute )
    90 783
    bytes of FARCODE memory
    What I would like to have as a final file:
    EXCEL COLUMN1
    Column 2
    Column3
    Column4
    Column5
    Column6
    MM/DD/YYYY
    filename1
    161179
    16789
    1875
    90783
    MM/DD/YYYY
    filename2
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    MM/DD/YYYY
    filename3
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!

    Hello
    You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
    set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
    use strict;
    use open IN => ':crlf';
    chdir $ARGV[0] or die qq($!);
    local $/ = qq(\\0);
    my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
    local $/ = qq(\\n);
    #     CSV spec
    #     - record separator is CRLF
    #     - field separator is comma
    #     - every field is quoted
    #     - text encoding is UTF-8
    local $\\ = qq(\\015\\012);    # CRLF
    local $, = qq(,);            # COMMA
    # print column header row
    my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    # print data row per each file
    while (@ff) {
        my $f = shift @ff;    # file path
        if ( ! open(IN, '<', $f) ) {
            warn qq(Failed to open $f: $!);
            next;
        $f =~ s%^.*/%%og;    # file name
        @dd = ('', $f, '', '', '', '');
        while (<IN>) {
            chomp;
            $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
            ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
            ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
            ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
            ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
            last unless grep { /^$/ } @dd;
        close IN;
        print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    EOF
    Hope this may help,
    H

  • How can I use automator to import a .csv file into a an excel file

    I would still like all the import settings that I get if I am using excel to do the process, i.e. going in with the text format instead of the general format. That way my dates don't change

    You'll need to use Applescript in Automator.
    Note:  File extension cannot be CSV (Excel will assume that the file is comma separated), so add an action to copy or rename with extension TXT.
    (You can rename back at end of Workflow is needed)
    The Applescript Action is:
    on run {input, parameters}
         repeat with f in input
              tell application "Microsoft Excel"
                   open text file filename (f as string) data type delimited field info {{1, text format}} other char "|" with use other
              end tell
          end repeat
          eturn input
    end run
    NOTE: This is formating the 1st col to text
    If you need to format the second, then you need to:
      open text file filename (f as string) data type delimited field info {{1, general format}, {2, text format}} other char "|" with use other
    (You'll need to list the 1st col, 2nd col, etc until you get to the col to format as text).  Formats are (from the Applescript Excel Library):
    [field info list] : A list contain parse information for the individual columns of data.
    Formats are general format, text format, MDY format, DMY format, YMD format, MYD format, DYM format, YDM format, skip column.
    Or you can skip using Automator and just use an Applescript App (this is a droplet, just drop the files on the icon, or click to choose files):
    on run
         set fs to choose file with prompt "Select one or more files to open:" default location alias (the path to desktop folder as text) with multiple selections allowed
         proceed(fs)
    end run
    on open fs
         proceed(fs)
    end open
    on proceed(fs)
         repeat with f in fs
              tell application "Microsoft Excel"
                   open text file filename (f as string) data type delimited field info {{1, text format}} other char "|" with use other
               end tell
          end repeat
    end proceed

  • How can I use Automator or AppleScript to get text from a web page and paste it in execl?

    I don't know how to make scripts or complexed automator workflows... that's why I'm asking.
    I'm trying to make a simple app or script to ask me what text to extract from a web page, like name, address and phone number of a web page and paste each one of these data in the righ cell of excel.
    I was thinking to promt a request from automator or an applescript to ask me which text to extract from the page or to look throught the HTML of the page to search for specific html tags, from which extracting text and then importing it, or paste it to the specified execl cell. Name in the name cell, address in the address cell and so on.
    Can somebody help me to make this script?
    If you know an alternative, like a software that already do this or another language to use, please tell.

    Try holding down the alt key as you mark the text to be copied. You can then copy columns to table text.

  • How can I use Automator to toggle the Function Keys?

    I am trying to create a Automated process to toggle the Function Keys on my keyboard. This is because I use several programs, including After Effects, which use the F1-12 keys, but when I am not using that program I commonly use the Apple-defined shortcuts on the keyboard. I have a full-sized keyboard, hence no Fn key. So that's out right away – I've read several comments on this topic where people suggested that this is the ONLY option. I refuse to beleive that.
    Automator contains a "Watch Me Do" feature, which I have tried to use to record this process. Problem is, it never clicks the right object. If I record clicking the dock, the magnification (I suspect) throws off the virtual-controlled mouse and picks the wrong object. If I record the Apple Menu route, it gets it about 1/2 the time.
    I think what I'm really looking for is a console command I can feed into the Terminal which toggles the keys. It seems to be that this HAS to be an option, even if it is more than one line of commands. I believe if I can feed this process into Automator, it would work.
    Any ideas?
    Thanks in advance, Mac Geniuses!

    iKey lets you define function keys per application. You seem to want to turn on & off the defined apple keys.  Not sure if these keyboard re-mappers will do the trick.
    Here is my other most favored application. Of course, I haven't checked these out in newer OS's. I'm a Tiger man myself.
    iKey is a front end program that simulates typing and mouse movements. I use iKey to remap the Function keys.
    "iKey is an automation utility, a program that creates shortcuts to accomplish repetitive tasks. In essence, an iKey shortcut is a little program in its own right, but you don't need to know the first thing about programming to create an iKey shortcut. All you have to do is put together three necessary parts of a shortcut: One or more commands that give the shortcut its functionality, a context in which it runs, and a launcher that defines how the shortcut is activated."
    http://www.scriptsoftware.com/ikey/
    iKey  has a little more function then the previous free version called youpi key. For many years, I used youpi key before switching to iKey.  It works fairly well for me in MAC OS 10.4 although not officially supported.  The youpi key download is hard to find & no longer here.
    http://www.versiontracker.com/dyn/moreinfo/macosx/11485&vid=75326
    ( Send me a message for a copy of youpi  key. )
    *Examples:*
    I have the common programs that I use assigned to function keys. I have F4 assigned to Firefox. When I want to start FireFox, I press F4. When I want to switch to firefox, I press F4! Starting & switching to an application in Mac OS are the same thing in Mac OS.
    Here is an example of to assign volumn control to a function key.
    http://discussions.apple.com/message.jspa?messageID=10361085#10361085
    Here is my script for listing my application folder. I have it assigned to function-key 6.
    tell application "Finder"
       open folder "Applications" of startup disk
       select Finder window 1
       set bounds of Finder window 1 to {-3, 44, 691, 545}
       --set position of Finder window 1 to {33, 44}
       set position of Finder window 1 to {60, 45}
       activate
    end tell
    The second portion of this script was generated in the script editor record mode. After I recorded the script and did some editing, I copy the script to ikey/youpi key.
    Full Key Codes
    http://download.cnet.com/Full-Key-Codes/3000-2094_4-44175.html
    Spark
    "Spark is a powerful, and easy Shortcuts manager. With Spark you can create Hot Keys to launch applications and documents, execute AppleScript, command iTunes, and more... You can also export and import your Hot Keys library, or save it in HTML format to print it. Spark is free, so use it without moderation!"
    http://www.versiontracker.com/dyn/moreinfo/macosx/22675
    Mac OS X remap or rename keyboard keys
    by vivek
    So how do you remap or rename keyboard keys under Mac OS X?
    Simply use DoubleCommand software.  It is a free program
    http://theos.in/apple/download-doublecommand-to-remap-keyboard-keys/
    Keyboard Maestro is a powerful macro program for Mac OS X (including Tiger and Leopard) which has received glowing reviews. Keyboard Maestro will take your Macintosh experience to a new level in “Ease of Use”. With Keyboard Maestro you can design a custom action sequence with your own shortcuts and use them at any time, you can navigate through running applications and open windows with Program Switcher, and you can work with an unlimited number of clipboards - all by pressing simple keystrokes.
    http://www.keyboardmaestro.com/main/
    "Spark is a powerful, and easy Shortcuts manager. With Spark you can create Hot Keys to launch applications and documents, execute AppleScript, command iTunes, and more... You can also export and import your Hot Keys library, or save it in HTML format to print it. Spark is free, so use it without moderation"
    http://www.versiontracker.com/dyn/moreinfo/macosx/22675

  • How can I use automator to open terminal change directory run a python script?

    Hi all,
    I dont really ever use automator - which may be my big problem - and I am trying to make an apllication that seems fairly simple in theroy. I want something that will lunch terminal, cd to the place where my python script lives and then run it. I have tried a number of suggested ways and can get the terminal to open and the directory to change but cant figure out how to run the script. This is my workflow if i did it manually each time
    - open terminal
    - type cd "the place where my file lives"
    - type python uploadr.py -d
    I can get terminal to open then cd to the right place but cant get the "python uploadr.py -d" to run without an error.
    any help would be very appricated
    thanks!!!
    J

    this is the script I got closest with - I know its something to do with breaking those two commands up but i just dont know how to do it
    on run {input, parameters}
              tell application "Terminal"
      activate
                        if (the (count of the window) = 0) or ¬
                                  (the busy of window 1 = true) then
                                  tell application "System Events"
      keystroke "n" using command down
                                  end tell
                        end if
                        do script "cd /Users/behole/Desktop/FlickrUpload/" & "python uploadr.py -d" in window 1
              end tell
              return input
    end run
    this is the error I get in terminal after I run it
    Last login: Mon Jul 23 15:37:17 on ttys000
    be-holes-MacBook-Pro:~ behole$ cd /Users/behole/Desktop/FlickrUpload/python uploadr.py -d
    -bash: cd: /Users/behole/Desktop/FlickrUpload/python: No such file or directory
    be-holes-MacBook-Pro:~ behole$

  • How can I use automator to copy and paste excel content to a new empty document?

    Hi,
    I would like to copy and paste the content from an excel file to another empty new document using automator, which I created a workflow like below
    get specific finder item
    open excel workbook
    select cell from excel workbook (all content)
    obtain selected content from workbook
    copy to pasteboard the content of excel workbook
    close the excel workbook
    create new excel workbook
    paste copyboard content to excel workbook
    can anyone kindly suggest what's wrong with this workflow?
    Thank you so much
    Eddy
    (i know this is a number place but I couldn't find any excel seciton sorry guys...)

    now it only does one file at a time, whereas I would like to do multiple files simultaneously.
    If you try a search for "loop Automator" and also "folder actions" you may find some usable pointers on how to do that.  The first example on this page looks promising.
    SG

  • How can I use Automator to search only in folders whose name contains a certain word?

    I'm very new to Automator. What I am trying to accomplish is this:
    I am using Transmit as my FTP client. I have mounted a server as a disk to my desktop. I am using Automator to try and search this server and open files whose path contains the word "mobile", then open files with the name "order.php" with my HTML editor. There are hundreds other files on this server that have the name "order.php", so I just want to target the ones found in paths with the name "mobile" applied.
    Where I get stuck is the "search only in paths that contain the word 'mobile' ".
    Please advise.
    Thanks.

    I'm very new to Automator. What I am trying to accomplish is this:
    I am using Transmit as my FTP client. I have mounted a server as a disk to my desktop. I am using Automator to try and search this server and open files whose path contains the word "mobile", then open files with the name "order.php" with my HTML editor. There are hundreds other files on this server that have the name "order.php", so I just want to target the ones found in paths with the name "mobile" applied.
    Where I get stuck is the "search only in paths that contain the word 'mobile' ".
    Please advise.
    Thanks.

  • How can I change the sender details on emails sent from one of 2 iphones linked to my itunes?

    I have 2 iphones set up on my itunes, one for me and one for my husband, when he sends an email from his iphone it shows as being sent by me not him. His hotmail email is set as the default on settings and it is his emails in the inbox,how can I change this?

    Use Settings > iCloud. Choose Sign Out at the bottom and then Sign In with your iCloud ID.

  • Acrobat Pro for Mac bought on Amazon;how can I register it?. registration code they give me, it doesn't work. (It has letters and the registration boxes won't accept letters.)  How do I get this to work?

    I purchased Acrobat Pro for Mac on Amazon. When I try to register with the registration code they give me, it doesn't work. (It has letters and the registration boxes won't accept letters.) How do I get this to work?

    If you don't have original install disks for your Mac, you can order replacements disks directly from Apple at a nominal cost. The original install DVDs are required to reset the password.
    If you have no data on your drive that you want to keep, you can boot up from the OSX Snow Leopard disk and install OSX SL.
    Insert the Snow Leopard DVD and hold the C key during startup. The Mac should boot from the CD/DVD drive into the installer.
    Follow the prompts, erase the disk and install OSX Snow Leopard.

  • How do you control the Subject Line in emails sent from RS_PREC_PLAN?

    We are using the program RS_PREC_PLAN to broadcast precalculated workbooks from a process chain.  We have entered values for each parameter (i.e. Precalc server, workbook, web template, and email addresses) and saved as a variant. 
    However, each time the program is called from the process chain the email recipient gets an email with "Test" as the subject line.  Is there any way to control what is displayed in the subject line of the email?
    Thanks,
    Brad

    Brad,
    Looks like the subject is hardcoded...
    you can find the same in
      Form  sent_mail
    where there is :
    l_r_parameter->add( i_id    = 'DESCRIPTION'
                          i_value = 'Test'(001) ).
    what you could do is create a copy of the same program and look at passing the subject to the program...
    Arun
    Hope it helps...
    You could also look at using the how to document on sending workbook as attachment available in SDN - created by Durairaj Athavan Raja,,
    Arun
    Hope it helps...

  • How can I use Automator to open and save Word docs with links?

    Hi-
    I'm having trouble building a Workflow to open and save Word docs with links.
    My Workflow so far:
    1. Get Finder items
    2. Copy Finder items (to new folder)
    3. Rename selected items
    4. Open selected items (Word docs)
    Three problems occur.
    The first is a Word 2004 problem -- I can't get the warning "This document has links in it; do you want to open it with/without updating the links" to go away (Unilke the Macro warning toggle capability, there is nothing in the Preferences for Word 2004 that addresses the links warning, as far as I can tell; any insight you can shed on this would be terrific.)
    The second problem happens with Automator: if I manually accept the update of the first document's links, Automator opens that document but then halts completely, even though I've instructed it to open multiple documents.
    The third problem I have is that there's no Finder action in Automator that allows me to save the document that's now open (as far as I can see).
    Any suggestions for how to fix? If I can get this to work, and scheduled in iCal, it will be an unbelievable time saver.
    Thanks,
    Jeremy
    PowerPC G5   Mac OS X (10.4.6)  

    Hi there Jeremy,
    to do this you are going to have to add in some Run AppleScript steps...
    These will rely on GUI Scripting. So first you need to activate GUI Scripting.
    Now we need to add in a Run AppleScript action to the end of your workflow...
    This will replace your current number 4 in the workflow (Open Selected...)
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">on run {input, parameters}
    set allItems to every item of input
    repeat with currItem in allItems
    tell application "TextWrangler"
    open currItem
    end tell
    activate application "TextWrangler"
    tell application "System Events"
    tell process "TextWrangler"
    delay 2
    --when the Word document is opened I have told it to press okay !
    --I don't know what key you want it to press in the dialog box
    keystroke return
    delay 2
    --save the doc
    keystroke "s" using command down
    delay 5
    --close the doc
    keystroke "w" using command down
    end tell
    end tell
    end repeat
    return input
    end run</pre>
    The above script should open each Word Document, press a button in the dialog box then do a save and then close the doc...then loop through the rest of them.
    You need to replace the name Text Wrangler with Microsoft Word (or whatever it is called!), I don't have it on my Mac.
    You will have to let me know what button needs pressing in the first dialog, if it isn't the 'highlighted ' one then we will have to amend the script...
    regards
    Ric

  • How can i use automator to change my browsers home page

    Hello there,
    I am a junior web developer currently using a macbook, i have wamp server installed on my machine for testing the code that i produce.
    Currently i have 2 browsers on my machine firefox and safari. I would like to create a script that would change my homepage to localhost only when wamp server is running. I am guessing this can be done with automator but i just don't know how.
    If anyone has any ideas that would be sweet!
    Peace

    If the files are in one folder, I'd change them with TextWrangler.
    First, copy the folder with the 12-point files. Work on the copy folder.
    Open TW
    Search > Multi-File Search …
    --Find: fs24  (i.e., an RTF code that indicates a 12-point font)
    --Replace: fs48  (i.e., an RTF code that indicates a 24-point font)
    --Search in:  Other: (target the copy folder)
    --Replace All
    Follow the dialog to Find & Replace All Matches:
    --Save to disk
    (There's no need to use the options to Leave open, Confirm before saving, or Show results.)
    --Proceed
    Quick and dirty but ought to work unless you actually use the string "fs24" somewhere in a document--and if you do, you do still have the original 12-point files.

  • HT1918 I made a new Apple ID because I lost the information to my email that I used with it. How can I use my same billing information on this new ID?

    I need to know how to like, verify I guess that it is my debit card, I just got a new email and Apple ID

    Changing the email address you use for your Apple ID -
    http://support.apple.com/kb/HT5621

  • How can i use automator to rename files erasing first 3 digits of their name?

    Actually in the files i am trying to rename the first 2 digits are numbers then space and then there is the file name i want to use. Hope this helps.

    Open the AppleScript Editor in the /Applications/Utilities/ folder and paste in the following text:
    tell application "Finder"
    set the_items to items of window 1
    repeat with this_item in the_items
    set name of this_item to (items 4 thru -1 of (get name of this_item)) as string
    end repeat
    end tell
    Navigate to the folder containing those files in the Finder and run the script.
    (65537)

Maybe you are looking for