Home Automator

Discussion in 'Programming' started by Thiago Snow, Nov 10, 2013.

  1. Thiago Snow

    Thiago Snow New Member

    Joined:
    Nov 10, 2013
    Messages:
    6
    Hi guys, my name is Thiago Neves, Im brazilian, leaving in Canada and Im working with some home automation and I registered myself here because I need a help with a project im developing. "The talking house".

    Thank you !
     
    Thiago Snow, Nov 10, 2013
    #1
    1. Advertisements

  2. Thiago Snow

    Thiago Snow New Member

    Joined:
    Nov 10, 2013
    Messages:
    6
    I don't know if this is the right place to post my question, but here it goes :

    I have a Mac Mini which is going to be in the basement, without any screen so the idea is to leave it running just to process this file...
    When I wake up in the morning or before I leave home, I press a switch in the house and the speakers on the hallway would tell me the temperature of the day in a personal way, like saying my name or my wife's...

    For that, I need to create a way of every 15 mins or so, to get the weather information and from that info, collect only what I need and create a .txt file with that info and a few custom phrases like "Good Morning (if its morning) Thiago, today is "today's date", the temperature is ___, partly cloud, and fews like ___, max of ___ and min of ___, have a wonderful day (or afternoon or evening)"

    Right now Im doing a big "go around" solution.
    Im using Excel and Im collecting data from 2 diferente sources of weather (one of them keeps on crashing and the other doesn't have enough information, so when it crashes I only know because the updated file says good morning when its already afternoon, so I have to go to the computer and fix the problem) so Im using lots of formulas to create the sentence. At the end I have to create a PDF file for some reason I couldn't create a regular txt file and I have the automator to create the TXT from the PDF.

    The problems Im bumping on to is if weather data crashes the whole excel crashes,
    Everytime the mac turns off, I have to start all the macros by hand (I put the macros to start by itself but for some reason the PDF file doesn't create)

    So thats not a reliable solution at all...

    I was wondering if there is a way of creating this automation file using Automator or Apple Script...
    Im sure there is a solution for that but Im just overwhelmed with all the info I have in my head that I can't organize everything and search into the app ...
    So when the computer goes off, when it goes back on, the file "Open at Login" and Thats it ...

    Thanks in advance !!!!
     
    Thiago Snow, Nov 10, 2013
    #2
    1. Advertisements

  3. Thiago Snow

    Kaveman VIP Member

    Joined:
    Nov 26, 2010
    Messages:
    3,559
    Location:
    Westland, NZ
    Automator can open a set of files.

    Get Specified Finder Items
    Open Finder Items
     
    Kaveman, Nov 10, 2013
    #3
  4. Thiago Snow

    Thiago Snow New Member

    Joined:
    Nov 10, 2013
    Messages:
    6
    Hi Kaveman, thanks for the replying.
    I've actually done that, but excel asks so many questions when open a file, so its hard to control that ...
     
    Thiago Snow, Nov 10, 2013
    #4
  5. Thiago Snow

    Kaveman VIP Member

    Joined:
    Nov 26, 2010
    Messages:
    3,559
    Location:
    Westland, NZ
    Excel might be a bad choice, and its also a bit crashy over time.
     
    Kaveman, Nov 10, 2013
    #5
  6. Thiago Snow

    Kaveman VIP Member

    Joined:
    Nov 26, 2010
    Messages:
    3,559
    Location:
    Westland, NZ
    Kaveman, Nov 10, 2013
    #6
  7. Thiago Snow

    Spawn_Dooley Moderator

    Joined:
    Jun 13, 2007
    Messages:
    2,471
    Location:
    van diemen's land
    moved and merged threads, thanks Kaveman
     
    Spawn_Dooley, Nov 11, 2013
    #7
  8. Thiago Snow

    Thiago Snow New Member

    Joined:
    Nov 10, 2013
    Messages:
    6
    No more help ?! :(
     
    Thiago Snow, Nov 11, 2013
    #8
  9. Thiago Snow

    Kaveman VIP Member

    Joined:
    Nov 26, 2010
    Messages:
    3,559
    Location:
    Westland, NZ
    excel in not an Apple product, and there is nothing we can do about what it does when it launches and opens a file.
     
    Kaveman, Nov 11, 2013
    #9
  10. Thiago Snow

    Thiago Snow New Member

    Joined:
    Nov 10, 2013
    Messages:
    6
    I understand that... I don't need help with Excel, I need a help developing a script or automation to get this weather data and make a txt file out of that data ...
    Thank you for your help !
     
    Thiago Snow, Nov 11, 2013
    #10
  11. Thiago Snow

    Thiago Snow New Member

    Joined:
    Nov 10, 2013
    Messages:
    6
    Ok, I actually thought of a better idea...
    Make Automator

    1- Open a URL, and save the website as "Page Source"
    2- Open saved "Source File" and collect a text in between specific tags (I've seen something like that, that you collect/copy the text that is between certain words)
    3- Paste into a new text file, collect data from another file lets call "TEMPLATE FILE" where I have the text that doesn't change and keep on adding to this new file until I have all the information I need that completes the whole sentence.
    4- Save "New file" as AnyName.txt


    Let me try a better visual example :

    SOURCE SAVED FILE (This file will be saved from the internet website and would always look like this) :

    Current Conditions
    5°C

    Condition:

    Light Rain

    Pressure:

    101.4 kPa


    Humidity:

    84%

    Wind:

    W 31 km/h

    TEMPLATE FILE (A file where I would always have this information that wouldn't change):

    xx Hello Thiago, the temperature is xx
    xxx degrees Celsius, the condition is xxx
    xxxx and the wind speed is xxxx
    xxxxx Have a good day xxxxx


    So now I open both files and collect few pieces at a time to complete my custom file:

    Copy from "Template File" text between "xx and xx" -> Add to NEW FILE
    Copy from "Source File" text between "Current Conditions and °C" -> Add to NEW FILE (Next to the first text from "Template File")
    Copy from "Template File" text between "xxx and xxx" -> Add to NEW FILE (Keep on adding)
    Copy from "Source File" text between "Condition and Pressure" -> Add to NEW FILE (Next to the first text from "Template File")

    Keep on adding the texts until I have something like this :

    " Hello Thiago, the temperature is 5 degrees Celsius, the condition is Light Rain and the wind speed is 31 km/h. Have a good day. "

    I hope this was understandable... Thanks all the ones willing to help !
     
    Thiago Snow, Nov 11, 2013
    #11
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ric

    Automator !

    Ric, May 20, 2005, in forum: Mac OS X
    Replies:
    8
    Views:
    2,518
  2. Ric
    Replies:
    1
    Views:
    1,292
  3. Ric
    Replies:
    1
    Views:
    1,328
  4. Ric
    Replies:
    0
    Views:
    2,986
  5. Ric

    Automator-Save file as JPEG !

    Ric, Sep 16, 2005, in forum: Mac OS X
    Replies:
    0
    Views:
    5,272
  6. Ric
    Replies:
    0
    Views:
    3,988
  7. jkevinwolfe

    Applescripting Automator

    jkevinwolfe, Sep 22, 2005, in forum: AppleScript
    Replies:
    6
    Views:
    2,256
    jkevinwolfe
    Oct 5, 2005
  8. Newsbot

    Home Sweet Home [(universal) Demo]

    Newsbot, Aug 19, 2008, in forum: Mac Gaming
    Replies:
    0
    Views:
    814
    Newsbot
    Aug 19, 2008
Loading...