How can I script my images? (part 2)
The other button on the template works slightly differently. The
embed tag for this button reads:
<embed src=script01.spt | width=15 | height=15 | button=push
| target=pdbimage>
Translation: When the button (15 pixels high and wide)
is pushed, use the script commands in the file named script01.spt
to modify the Chime image named pdbimage.
With this type of button, the script command are in a separate file. Script
files must be plain text and have the .spt extension. You can
enter script commands just as you would in an embed tag. The script
file script01.spt, which is used to modify
the image on Page 6, is shown below. If
you want to save this script on your N: drive, point at the script01.spt
link above and use the save file as command.
Commands in the script01.spt file:
reset | rotate z 11 | rotate y 3 | rotate x -12 | zoom 197
| select all | colour cpk | spacefill 120 | wireframe 30
A particularly handy way to make script files is to let Chime do the scripting
for you! To do this follow these instructions:
-
Use the Chime menu commands to modify the image on the web page to get
it the way you want it to look.
-
Activate the Chime menu and select the Edit-Copy Chime Script option.
This command will automatically create a Chime script needed to generate
the image on the screen and copy it to the computer clipboard.
-
Paste the contents of the clipboard into a text editor such as Notepad.
You will see a series of script commands. It is a good idea to delete
the load pdb command (usually the 5th line). This command
often uses an incorrect file name and causes the image to disappear.
Many of the other lines are also extraneous and can be deleted to streamline
your script.
- Save the edited script file on your N: drive as "scriptname.spt"
(on a PC, include the quotes so your text editor doesn't add an
unwanted .txt extension).
- Modify the embed tag for the second button
on the template page, so the source (src) matches your script
file, and the target matches your image
file. Then preview the template page to see if it works.
|