How to add the AccuWeather Icons to your control page
Tonight I tried to see if my tip for getting the AccuWeather icons into a control page would work.
The good news is: it works!
The bad news is: you'll be off the streets for about 1-2 hours...
Some other good news: here's a ZIP file
with stuff I made today to get it working. But read the whole post before you use it!
These are the steps to follow:
1. Go to http://accunet.accuweather.com/wx/accun ... _icons.htm
and download a ZIP file with the icons you want.
2. The ZIP file contains files with a name like 01.GIF. You'll have to change all these files to AWI01+true.png, where 01 offcourse is the corresponding file number. There are 44 files, so this is a nice time to start using Automator.
For each file: open it in Preview and save it in PNG format.
In my ZIP file, you'll find the results from option 1 in a folder named "sym3".
3. Move your PNG files to /Library/Application Support/Perceptive Automation/Indigo 2/IndigoWebServer/images/controls/variables.
4. From my ZIP file, select all AWInn.png files and move them also to the variables folder.
5. Open your copy of the AccuWeather attachment script and scroll down to the user choosen extra fields. Enable the WeatherIcon field.
6. Scroll down to the end of the extra fields list and add the following code:
- Code: Select all
-- Only enable this portion when the WeatherIcon is used
tell application "IndigoServer"
set theIcon to value of variable "AWWeatherIcon"
set i to 1
repeat while i < 45
if i < 10 then
set num to "0" & (i as string)
set num to (i as string)
setVariable("AWI" & num, theIcon = num)
set i to i + 1
7. Save the AccuWeather attachment and reload the scripts in Indigo.
8. Here comes the rest of your evening:
Open an existing control page or define a new one.
Add an item to this page with the following properties:
Display: Variable Value
As image: AWI01.png
Repeat this for all 44 images...
The tricky part is that you will not see the images again in your control page. That is because Indigo shows the AWI01.png image for instance and this is an transparent image. But you can click on it to see it's size and to move it where you want it.
Place all 44 images exactly above each other, because the code you entered in step 6 will allways enabled 1 of the 44 images.
That's it! View your control page to see the result.
Now if you really don't like to add 44 variable values to your control page, you can try the following, but read this first:
CAUTION: if you perform the following step, it will be completely at your own risk. So only do it if you're sure you know what you are doing and you feel comfortable doing it.
It is possible to copy a predefined control page to your Indigo database. To do this, stop the Indigo Server process and make a backup copy of your Indigo database.
Check to see if you have made the backup of your database.
Verify that you have checked that you have made a backup of your database.
Open the database file in TextEditor.
Use the search function to find this element: </ControlPageList>
Include the contents from the file ControlPage sample.xml above the line where you found the </ControlPageList> element.
Save the database file and restart Indigo.
(Matt, if you don't like this advice, please feel free to moderate.)
 Small bug in AppleScript code above fixed. [/edit]