Author Topic: WeatherCat Scripts of 2013-12-01  (Read 89741 times)

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: WeatherCat Scripts of 2013-12-01
« Reply #60 on: July 26, 2015, 12:58:00 AM »
Old? What's wrong with "Old"? [rolleyes2] I'm still a quite young 72!! [cheer]

OTOH, one of the scripts I was looking at does use "Properties" instead of your updating some to use a separate 'pref' file.

I am looking at the "WC AppleScript Tags Processor" script/app and wondering about deleting several parts (functions?). Namely, Twitter and even Growl functions (although I use Growl).

I'm particularly interested in finding out more about the "SED" or "sed" commands (no, I haven't Googled that, yet OK, SED/sed stands for "stream editor" used in command line systems). That looks like something that could run the simple "uptime" bash command. I can already generate a txt file with the results of that command, but I need a way to insert it into one of the pages WC updates. Perhaps that's what your "pseudo" tags do?

Frankly, that's one huge script! And it's been years since I tried to do anything with AS. [banghead] I'll study it a bit more and see if I can understand it before creating a short book of questions... [computer]

Anyway, no urgency, anytime tonight will be fine. :P [roll]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Answers . . (Re: WeatherCat Scripts of 2013-12-01)
« Reply #61 on: July 26, 2015, 10:18:20 PM »
Dear X-Air and WeatherCat Scripters,

OTOH, one of the scripts I was looking at does use "Properties" instead of your updating some to use a separate 'pref' file.

Virtually all of the scripts use Properties.  Those are values that are global and can be accessed by any of the Methods (Subroutines for former Fortran/BASIC types.)  It was the best way to share some values - especially configuration settings.

I am looking at the "WC AppleScript Tags Processor" script/app and wondering about deleting several parts (functions?). Namely, Twitter and even Growl functions (although I use Growl).

The Twitter functions do no harm if you just ignore them.  That script only uses Growl to indicate that it is launching and quitting.  That shouldn't bother you any.

I'm particularly interested in finding out more about the "SED" or "sed" commands (no, I haven't Googled that, yet OK, SED/sed stands for "stream editor" used in command line systems). That looks like something that could run the simple "uptime" bash command. I can already generate a txt file with the results of that command, but I need a way to insert it into one of the pages WC updates. Perhaps that's what your "pseudo" tags do?

Exactly, WC AppleScript Tags Processor has the job of collecting data from the other AppleScripts and making them available as tags just like WeatherCat tags.  It may seem complicated, but I think you'll find it easier to use the constellation of AppleScripts - so long as you follow the instructions!!


Frankly, that's one huge script! And it's been years since I tried to do anything with AS. [banghead] I'll study it a bit more and see if I can understand it before creating a short book of questions... [computer]

Unfortunately, these AppleScripts suffer from having been "added onto" and "added onto" to an extreme excess.  They started out as a personal need to be alerted when the communications failed between WeatherCat's predecessor and VP-2 console.  They got expanded in a rather hackish manner during a dark period for those of us long timers who remember "BW" (Before WeatherCat.)

I really like them and would feel naked if I had to run WeatherCat just by itself.  Nonetheless they are just worn out.  As soon as I find the time, they have to be rewritten.  If possible I want to convert them into WeatherCat plugins and provide a proper Mac user interface.

Oh well, back to wiring the headlights . . .

Cheers, Edouard

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: WeatherCat Scripts of 2013-12-01
« Reply #62 on: July 27, 2015, 12:21:23 AM »
Quote
Unfortunately, these [fill in language] suffer from having been "added onto" and "added onto" to an extreme excess.
An indication of a self-taught "programmer"! [blush] [banghead] [biggrin] You should see some of the CSS files on my first large site! [lol] [computer] Kinda reminds me of having a committee communicating at night by smoke signals build a blind elephant... er, sumthin' like that...

Rewriting these is probably a good idea, anyway. I wonder how much longer Apple will continue support for AS or even Automator. Neither are cross-(any)platform, especially the driver of the Golden-Goose hardware sometimes called iDevices. Apple has dropped software that they decide no longer sells new hardware.
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Alan Rowley

  • Strong Breeze
  • ***
  • Posts: 150
  • It is far better to wear out than to rust away.
    • D3696
    • INOTTING15
    • Selston Weather
  • Station Details: Weather station: Davis Vantage Pro2. Software: WeatherCat. Computer: Mac Mini, High Sierra OS
Re: WeatherCat Scripts of 2013-12-01
« Reply #63 on: October 14, 2015, 07:08:47 PM »
Hi,

I am trying to make a status page, but I have absolutely no experience of Applescript. I have downloaded the WC Scripts and read the documentation, but I am totally baffled.

Can anyone give me step-by-step, idiot proof instructions on how to get this working? This is what I have got so far - click here.

Thanks - ALAN.

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: WeatherCat Scripts of 2013-12-01
« Reply #64 on: October 14, 2015, 08:29:51 PM »
I'm sure Edouard will be along in a minute or two; he's the author of most of the AppleScripts. I'd also suggest taking a look at the WC Tags list in the manual (~page 193 and up). There may also be a "index.html" file in the WC download, it's simply the tags list in an html table display.

Looks like you have the general format for the "tags" on that page. Only problem is that they appear to be "tags" you created yourself (although I've not checked every one of them...). For example, "Uptime" info is available with a "UT$" tag, and it will automatically add "Uptime: " and the uptime converted to the format you have set in the WC prefs (no need for AS for that one). While your "WCupTime$" makes perfect sense to me (which should make you a little worried!) , WC is not quite that 'smart'. ;)

OTOH, perhaps the 'tags' I see on your page are what AS uses. I've never added any to my site, so I'm a complete NOOB in that area.
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Alan Rowley

  • Strong Breeze
  • ***
  • Posts: 150
  • It is far better to wear out than to rust away.
    • D3696
    • INOTTING15
    • Selston Weather
  • Station Details: Weather station: Davis Vantage Pro2. Software: WeatherCat. Computer: Mac Mini, High Sierra OS
Re: WeatherCat Scripts of 2013-12-01
« Reply #65 on: October 14, 2015, 08:35:42 PM »
Thanks for your comments XAir. The HTML content you see is lifted from the documentation with the AppleScripts. I know how to get the normal WCTags to display, but I don't understand how the ASTags work.

ALAN.

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: WeatherCat Scripts of 2013-12-01
« Reply #66 on: October 14, 2015, 09:03:56 PM »
Quote
I don't understand how the ASTags work.
Ah! That requires a special, secret handshake that I'm not allowed to describe on this non-secure site. :o First, Edouard will send you a code that you will use to decipher the second code he'll send. After that, you'll have to set up a VPN with him and he can explain everything in detail. It will help if you have some knowledge of <old station wagons>...
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Randall75

  • Storm
  • *****
  • Posts: 1332
  • CWOP-CW6734 WeatherUnderground-KOHNEWAR6
    • CW6734
    • KOHNEWAR6
    • Randy's Weather On The Hill
  • Station Details: Davis Vantage Pro 2 Plus.iMac i5 OS High Sierra 10.13.6 8GB Ram, WeatherCat 3,Logitech 9000 Pro Web Cam
Re: WeatherCat Scripts of 2013-12-01
« Reply #67 on: October 14, 2015, 09:26:48 PM »
Hi Alan
 You must have the Station_console.html in the same file the WC process the rest of your web pagesI have mine called WC Custom Web Templates folder
After they are processed they go to my WC Custom Web folder which is uploaded to my web site
Read the instructions very closely


Hope this helps


PS from what I'm seeing you have the html file in the wrong folder which in uploading to your site they need to be in the folder that WC processes first the they will be moved to the folder the the cat uploads


cheers


 [cheers1]

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Requires multiple AppleScripts (Re: WeatherCat Scripts of 2013-12-01)
« Reply #68 on: October 14, 2015, 11:10:03 PM »
Dear Alan and WeatherCat scripters,

I am trying to make a status page, but I have absolutely no experience of Applescript. I have downloaded the WC Scripts and read the documentation, but I am totally baffled.

Can anyone give me step-by-step, idiot proof instructions on how to get this working? This is what I have got so far - click here.

Unfortunately, the best instructions you'll find are those documentation files that you'll find with the AppleScripts.  Alas, the scripts are "hobbyist grade" and have absolutely zero graphical user interface.  Most of them were written for my own needs and many were quickly written in a "dark time" before WeatherCat.

To make a status page, you need to get two AppleScripts working: WC Status Growler and WC Web Data Uploader.  The WC Status Growler AppleScript does the work of checking on WeatherCat and OS X and collecting values like how much memory WeatherCat is using.  These values are then made available to the WC Web Data Uploader AppleScript.  WC Web Data Uploader basically replicates the substitution process that WeatherCat does in templates for my AppleScript.  Because WC Web Data Uploader substitutes values for web tags and needs to do this before WeatherCat does any processing, there is a very specific arrangement of directories required.  All this needs to be done "by hand" or the system will not work.

In addition, since there is no user-interface, the preference files are actually tiny AppleScript programs.  So you need to get a basic familiarity of the Script Editor in order to configure any AppleScript.  The whole system of AppleScripts also has been "hard-coded" into a particular directory structure.  If you don't put all the AppleScripts in subdirectory of your user Applications folder, the AppleScripts won't work.  These locations have to be fixed because that's how the AppleScripts find the preference files and libraries of shared routines.  To make these AppleScripts work, you really need to keep everything as I have it on my computer.

As I've said this won't be easy to do and you'll have to struggle through with my lengthy detailed instructions to make all of this work.  If you really want to take this project on, I suggest that you start with one of the very easy AppleScripts to work on like WC Temperature Rising or WC Zambretti Forecaster.

You will probably need to install Growl because virtually all the AppleScripts depend on it and it is the closest these AppleScripts have to display system:

http://growl.info/

Lurking beyond all the other problems might be an issue with the Apple gatekeeper.  If it appears that you cannot run the AppleScripts at all, let me know.  You may have to "take ownership" of the code so that Apple doesn't think you are trying to run "hostile" AppleScripts on your Mac.

Sorry, as X-Air points out, I've been really overwhelmed by other things.  I have hoped to completely rewrite these AppleScripts as WeatherCat plugins, but I haven't had time to learn X-Code so that project remains for the not very near future.

Let me know if I can be of further assistance.

Cheers, Edouard

Alan Rowley

  • Strong Breeze
  • ***
  • Posts: 150
  • It is far better to wear out than to rust away.
    • D3696
    • INOTTING15
    • Selston Weather
  • Station Details: Weather station: Davis Vantage Pro2. Software: WeatherCat. Computer: Mac Mini, High Sierra OS
Re: WeatherCat Scripts of 2013-12-01
« Reply #69 on: October 16, 2015, 02:07:37 PM »
I've abandoned the idea of using AppleScripts for a status page, mainly because I don't want to purchase and install Growl just to produce a page that will barely be seen. Looking at the scripts, I dare say that I could get the status page working, but it hardly seems worth the effort.

ALAN.

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: WeatherCat Scripts of 2013-12-01
« Reply #70 on: October 16, 2015, 08:55:21 PM »
Looks like you've already "followed" my advice, even before I 'gave' it! Scary!!! [lol2]

Was there anything in particular (other than uptime) that you really want to display? Stu has very little to do and is always looking for features to add to WC! ??? :P Since WC is already generating the info on the "Status" screen, it should be extremely easy (for him) to make all that info available... [computer]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Status info UNIX hacks (Re: WeatherCat Scripts of 2013-12-01)
« Reply #71 on: October 17, 2015, 09:13:53 PM »
Dear X-Air and WeatherCat infomaniacs, . . .

Was there anything in particular (other than uptime) that you really want to display? Stu has very little to do and is always looking for features to add to WC! ??? :P Since WC is already generating the info on the "Status" screen, it should be extremely easy (for him) to make all that info available... [computer]

I'm sure it is possible to get all the information that is collected by WC Status Growler in a Cocoa application, but I'm not sure how easy it would be.  Some of the information already does come from WeatherCat via the AppleScript interface (things like WeatherCat up time.)  All the rest is obtained by various hacks of UNIX command line utilities that can be run from within AppleScript.  Since those utilities are part of open-source UNIX distributions, the source code is out there.  However, I would expect it to be quite a chore to ferret out the relevant bits.

If there some status information that people really want to have, perhaps indeed it would be worth making a feature request.  However, honestly I think we should allow the developers of the more popular web templates get the most of Stu's attention.  As Alan points out, very few web visitors will be much impressed with this sort of information.  The only situation where it might be useful is when trying to monitor your weather station while far from home.  In such cases you really need to have remote desktop access anyway.

Cheers, Edouard 

gioman

  • Gentle Breeze
  • **
  • Posts: 11
    • CW8735
    • KNCHENDE18
  • Station Details: vantage Pro2
Re: WeatherCat Scripts of 2013-12-01
« Reply #72 on: October 28, 2015, 02:30:43 PM »
Hello Edouard,

I posted this over where you had your last comments on the Status Growler but repeat here in case you don't see the other.


Thanks to a system update OSX10.11.1 last night I lost your very helpful script, WC status Growler.    :(  I have never used these silly smileys but without the Status Growler this silly symbol is very appropriate. 

Any ideas on how to get this script to work again. Using the option key as someone mentioned a couple of years ago does not work.

Thanks heaps.

keith

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
OS X security setting? (Re: WeatherCat Scripts of 2013-12-01)
« Reply #73 on: October 28, 2015, 10:35:09 PM »
Dear Keith and WeatherCat scripters,

Thanks to a system update OSX10.11.1 last night I lost your very helpful script, WC status Growler.    :(  I have never used these silly smileys but without the Status Growler this silly symbol is very appropriate. 

Any ideas on how to get this script to work again. Using the option key as someone mentioned a couple of years ago does not work.

What happens when you try to launch the script?  I suspect that the problem is that El Capitan has once more changed the security settings and you'll need to get around that.

Something to try is to try opening the application with the Script Editor and saving it as just a script.  The open up the script that you just saved and save that as an application in a different location from where the original application was.  Finally, replace the old application with the new one you have just created.

I think there is a problem of OS X detecting that the file wasn't created on your Mac.  As such it suspects that this could be some sort of malware.  If you create an AppleScript application yourself, it should assume that it is what you wanted - it is your creation.

See if that get's you running once more.

Cheers, Edouard

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: WeatherCat Scripts of 2013-12-01
« Reply #74 on: November 18, 2015, 08:57:35 PM »
Edouard,

OK, I've screwed something up and can't recall how to fix it...

We had a power outage due to high winds, and my iMac restarted. Like every time it crashes hard like that, apps that were running come back up running. Some can be quit, and others need force-quit. That's typically the case with the running applescripts. So I quit everything, did a permissions and disk repair (that sure is different under ElCap) and restarted.

Everything works except the WC Applescript Tags processor, upon which several other scripts rely. I get:



I can't quit it. I have to force quit. And it does the same thing again.

So I downloaded the AppleScripts package from the first post in this thread to get a new, unbusted copy of the Tags Processor. Except



Now, I know we've had this come up before on things. I think it is the app is not signed or something. Didn't we have me create the AppleScript application locally to get around this? If so, I can't recall where or how. Trying to open it in Script Editor yields the same error message as above, as does option-opening and command-opening. I can see the contents of the app, but not sure if what I need to create it locally is in there.

If you have a suggestion, I'd sure appreciate some ideas.
Thanks,
Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook