activate artboard and layer
- March 18, 2024
- 1 reply
- 755 views
Kindly see the attached Word document for a description of my issue. I will copy the word document here:
Hello all,
Once again, my frustration level has exceeded my usually high tolerance level, and I am seeking your help and guidance.
I am trying to develop a script that will produce a sequence of numbers either with or without a prefix or suffix to be used in a wide variety of applications. A sequence of numbers to label lab specimens; a sequence of numbers representing electronic microscope images of a specific object; a sequence of numbers representing pages in a notebook. I even want a sequence of numbers showing dates of coins that I collect. You get the idea. For years I have typed these sequences by hand or had someone else type in the numbers. What a great idea for a script. If only I could write one that worked!
Outline of my ideas:
- Get data – starting number, ending number, prefix, suffix, number of leading zeros, etc.
- Calculate the number of pages needed to make the sequence. I have used up to 8 pages in the past.
- Generate an artboard and layer for each page. I know that no data is stored in the artboards, but I still need sheets of paper to fill and will hold data in the layer.
- Produce one page (artboard) at a time with part the list of numbers / sequences. Save the document. Then, move on to the next page. Simple!
I believe the key to addressing multiple pages and layers is through activation. I mention this as I might be way off base with this idea. I want to activate an artboard and associated layer. Fill the page with part of the sequence, save the document, then switch to the next artboard and layer and continue with the sequence.
So far, I have utterly failed to get this to work. A simple test application is shown. Two artboards and two layers are generated. The first artboard and second layer is activated and a text frame is made to hold a sentence. Next an attempt to activate the second artboard and third layer is made and a new text frame with a sentence is written to the newly activated layer and sequence.
What happens is that both sentences appear on artboard 1 and in layer 2. Screen shot made; not sure if allowed but will try.
Kindly have a look and let this idiot know what I am doing wrong.
Many many thanks for taking the time to look at this problem and taking the time to correct my thinking or code or idea.
Over and out, Kent
