Page 1 of 1

MAC Evocam

Posted: Tue 21 Nov 2017 10:27 pm
by UncleBuck
Does anyone here use Evocam on MAC?
I have been using it for a while now and have a script I use (that runs within the app) to overlay the current conditions using the realtime.txt data.
If anyone is interested, I can post it here with some basic instructions on how to set it all up.

Re: MAC Evocam

Posted: Fri 29 Dec 2017 4:22 pm
by braecottage

I'm using Evocam for os x. Any pointers on how to overlay would be appreciated.


Re: MAC Evocam

Posted: Sat 31 Mar 2018 10:54 pm
by UncleBuck
Hi Kevin,
Sorry for the REALLY late reply on this one. Are you still interested in the overlay side of things using EvoCam?


Re: MAC Evocam

Posted: Mon 02 Apr 2018 12:30 am
by UncleBuck
Thought I would post it here anyway, just in case there is anyone else who needs it.

First Steps:
Create 2 text items in the Evocam display, one called "Now" and the other called "Today".
Set up a new action that has a Time period: of "Always" and a When ever any of these conditions occur: as every 5 seconds. (you can set this to whatever time period suits you best)
Now create a Perform these actions: as "Run Script" and paste the following script into it:

Code: Select all

set theFile to "YOUR:PATH TO:realtime.txt"

set resultText to {}
set resultText to readAndSplitFile(theFile)
set nowText to item 1 of resultText & " " & item 2 of resultText & return & "Temp: " & item 3 of resultText & "c" & return & "Wind: " & item 7 of resultText & " km/h " & "from " & item 12 of resultText & return & "Rain Rate: " & item 9 of resultText & " mm/h" & return
set todayText to "TODAY" & return & "Max Temp: " & item 27 of resultText & "c @ " & item 28 of resultText & return & "Min Temp: " & item 29 of resultText & "c @ " & item 30 of resultText & return & "Max Gust: " & item 33 of resultText & " km/h @ " & item 34 of resultText & return & "Rain: " & item 10 of resultText & " mm"
tell application "EvoCam 5"
	tell document "Default.evocamsettings"
		set title of text item "Now" to nowText
		set title of text item "Today" to todayText
	end tell
end tell
--set text item delimiters to ""
on readFile(theFile)
	-- Convert the file to a string
	set theFile to theFile as string
	-- Read the file and return its contents
	return read file theFile
end readFile
on readAndSplitFile(theFile)
	-- Convert the file to a string
	set theFile to theFile as string
	-- Read the file using a specific delimiter and return the results
	return read file theFile using delimiter space
end readAndSplitFile
There are a few of things you need to change in the script....
1) Change "YOUR:PATH TO:realtime.txt" to point to the location of your realtime file making sure that you use the quotes and the colon format.
2) Change the document name (Default.evocamsettings) to the name of your Evocam document.
3) Change the units of measure to reflect what it is you use (metric or imperial).

Once you have set all this up and have it running, move the text fields (Now and Today) to suitable locations in your image display.
Hope that helps...