PixInsight Forum (historical)

PixInsight => General => Off-topic => Topic started by: RobF2 on 2010 June 19 02:14:37

Title: Assign icon to script
Post by: RobF2 on 2010 June 19 02:14:37
Can I assign an icon to a script?
I'm using Nikolay's animation script as my first processing port of call now, and I'd like to add an icon to those that load on PI startup.
Title: Re: Assign icon to script
Post by: Juan Conejero on 2010 June 19 02:49:27
You can assign an icon to a script, but the icon will be shown on the Script menu only. Any process icons of the Script class will show the standard blue/orange "S" icon on the workspace, irrespective of the script's own icon. This will change in a future version.

Anyway, to assign an icon to a script you just have to add the following lines at the script's beginning:

#feature-icon <icon-file-name>

where <icon-file-name> represents the file name of an icon image in the PNG, TIFF, JPEG, BMP, GIF or XPM formats (PNG recommended). The icon should be 24x24 pixels, and can have a transparency (alpha) channel. Normally you should place the icon file in the same directory as the script's .js file(s) —C:/PCL/src/scripts by default—, and in such case you don't have to include a full file path, just the file name.

So far the standard scripts don't have icons; this is a pending task.
Title: Re: Assign icon to script
Post by: RobF2 on 2010 June 19 04:59:02
Thanks Juan

I am interested in an icon on the workspace, even if generic - I'm unlikely to leave too many icons there.
I found I can drag a generic script icon from the Process Explorer, then point it at the Animate script.  When I double click on it though it comes with a Script Parameters dialogue rather than appearing to run?   ???

Sounds like this is something future versions may do
Not a big deal of course..... :)