Ericoxer Posted March 3, 2007 Share Posted March 3, 2007 Ok, so I am atempting to write my first vectorscript, but im a little lost as to where to start. My script is meant for spotlight, and what i want it to do is select all my instruments, and accessories, etc and copy the x coordinate to a user field for export. So I know what i want it to do, I just can't figure out how to select the instruments. without getting an error. Quote Link to comment
Jonathan Pickup Posted March 3, 2007 Share Posted March 3, 2007 the easy way to get started is to try the command Tools > custom selection... Quote Link to comment
Petri Posted March 3, 2007 Share Posted March 3, 2007 ...and then you save the custom selection script and paste it into your main script. It could have a line something like R IN ['Instruments', 'Accessories', ' etc'] were 'R' is for Record Format. I'd probably use one of the "FOREACHOBJECT" -constructs. While these are definitely in the deep end for someone writing their first script, it is better to learn to write good, structured scripts. Having said that: if you have an exclusive custom selection, you can process the objects with objectHandle := FSACTLAYER; WHILE NOT(objectHandle = NIL) DO BEGIN {do stuff} objectHandle := NEXTSOBJ(objectHandle); END; There are indeed situations when selection and processing need to be separated. The quite clever bit with the above assignments is that the first one implies the criterion to be used in the latter one: selected objects on the active layer. Getting a handle of handles is extremely important... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.