Automator Workflow Help

Discussion in 'Mac Basics and Help' started by Aperture, Jul 30, 2006.

  1. Aperture macrumors 68000


    Mar 19, 2006
    Hi. When school starts up again in the end of August, I want to have an Automator Workflow setup so it can sync all my devices completely automatically. First, let me show you my plan.
    Computer Boots On: 6:30AM Mon-Fri
    AlarmClock Wakes Me Up
    iCal Alarm Launces Automator Script
    Automator Erases Old Notes
    Automator Launces "SyncNow"
    (An Application that launces iSync automatically and syncs all your devices so you don't have to press "Sync")
    SyncNow/iSync Syncs iCal & Address Book W/ My Verizon Razr
    Both Applications Quit
    Automator Gets New Mail
    Automator Combines my mail messages
    Automator creates a new ipod note with that file
    Automator Goes To URL:

    Automator Copys All Text From Page
    Automator Filters Text.
    ^^^I need help here. I want to filter it down to the "current conditions" Not Sure How

    New iPod Note > KDKA Weather
    Update iPod

    I need help getting the "Weather" To work. Also, I get the message at the end of the workflow execution that it can't eject my ipod as it is in use. Every other app besides Sync Now and iSync are currently open. Mail, iTunes, and the Automator Script. Which one is using the iPod, iTunes I guess? How can I have iTunes automatically Quit in Automator? I couldn't find an action to quit an app, is there one? Sorry for the long post.

    Thanks, Kevin
  2. elfin buddy macrumors 6502a

    elfin buddy

    Sep 16, 2001
    Tuttlingen, Germany
    Wow, you're certainly ambitious, haha :D I love it!

    I'm not sure if Automator will filter text for you (don't have my PowerBook handy to check it out), so I would likely go with an AppleScript or some other solid code to do that for me. If I'm not mistaken, Automator can call other scripts and launch applications, so it shouldn't be too hard. Actually, I'd likely compile a C application to do it for me, since I'm much better with C than AppleScript.

    So, I take it that you have an HTML document that you want trimmed down just to the useful weather? That shouldn't be *too* hard to do, if you know C or something. From what I see in the HTML source of the site, there are two key places on the page from which you would want information. Their positions are both marked by "day1", and are the first and third occurance on the page, I believe. Just make some code to copy, say, the five lines following each occurance, and remove everything inside "<" and ">".

    With respect to the iPod, there should be a function in the AppleScript iTunes dictionary that will eject the iPod for you. Make a little script for that.

    I believe AppleScript can also tell applications to quit too...which should solve your third problem. Let me know if I can be of more help by possibly giving you some sample code or elaborating further on anything.
  3. GimmeSlack12 macrumors 603


    Apr 29, 2005
    San Francisco
    It is good to see an Automator guy! I really like this program.

    As for your filtering problem I have a solution in the works, so far I can get the weather text pasted into a new TextEdit file, but I am having a tough time filtering the text. Although I have made leeway on filtering I cannot get it to filter out just what you want. Anyway this is what I got.

    Safari: Get Specified URL (enter you weather URL)
    Safari: Get Text From Webpage
    TextEdit: Filter Paragraphs (I've kinda got this to work)
    TextEdit: New Text File (name it weather.txt or something)

    That seems to work, but the filtering paragraphs won't recognize the "Current Conditions" as a paragraph, I'll keep working on it, but I hope that is advancing your Workflow progress somewhat.
  4. GimmeSlack12 macrumors 603


    Apr 29, 2005
    San Francisco
    I can get it to work, but not all at the same time. Automator lacks 'And' and 'Or' functions and therefore I can only have it filter out lines with 'current conditions' or that have '2 tab spaces' (which is the temp, and conditions lines). This is a problem as I can either get the text 'Current Conditions' or I can get all of the data lines (cause they have 2 tab spaces). So I am a bit out of ideas now.

    As for the iPod not ejecting, why is iTunes open? I believe you can use the update iPod workflow and not actually have to have iTunes open. If not then oh well. But that is a thought.

Share This Page