Home Automator

Joined
Nov 10, 2013
Messages
6
Reaction score
0
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 !
 
Joined
Nov 10, 2013
Messages
6
Reaction score
0
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 !!!!
 
Joined
Nov 26, 2010
Messages
3,558
Reaction score
52
Automator can open a set of files.

Get Specified Finder Items
Open Finder Items
 
Joined
Nov 10, 2013
Messages
6
Reaction score
0
Automator can open a set of files.

Get Specified Finder Items
Open Finder Items
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 ...
 
Joined
Nov 10, 2013
Messages
6
Reaction score
0
excel in not an Apple product, and there is nothing we can do about what it does when it launches and opens a file.
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 !
 
Joined
Nov 10, 2013
Messages
6
Reaction score
0
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 !
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top