-
1. Re: Scripting: Prompt a Dialog Box to add text to part of my existing Script.
Silly-V Dec 29, 2016 1:00 PM (in response to ArtsieGirl305253)In your code, what does rec_group1 reference to?
Out of curiosity, can you tell us what kind of "Scripting Palette" you guys are using?
-
3. Re: Scripting: Prompt a Dialog Box to add text to part of my existing Script.
pixxxel schubser Dec 29, 2016 2:16 PM (in response to ArtsieGirl305253)It seems you have trouble with your syntax. And I miss necessary parts in your code. Furthermore: the version of your Illustartor is absolutely required for the correct position of your die_num
If I understand you right, you need something like this
var thisDoc = activeDocument; var rec_group1 = thisDoc.layers.getByName("rec_group1"); var magThick = "0,250"; var newDieName = prompt ('Enter Job Number for New Die', " ","Creating Die"); if (newDieName) { var die_num = rec_group1.textFrames.add(); die_num.contents = "DJ" + newDieName + ".01" + "-" + " " + magThick; die_num.moveToBeginning(rec_group1); die_num.textRange.characterAttributes.size = 12; die_num.textRange.characterAttributes.textFont=app.textFonts.getByName("MyriadPro-Regular"); die_num.textRange.characterAttributes.fillColor = thisDoc.swatches[4].color; // Determines where the die number should be placed. die_num.top = -170; die_num.left = -54; die_num.filled = true; die_num.overprintFill = false; die_num.rotate(180); // End of die number creation };
One question (if allowed) Where do you come from?
Have fun
-
4. Re: Scripting: Prompt a Dialog Box to add text to part of my existing Script.
williamadowling Dec 30, 2016 9:10 AM (in response to ArtsieGirl305253)One issue I can see right off the bat.. these first 2 lines:
var newDieName = prompt ('Enter Job Number for New Die', " ","Creating Die");
var newDieName = newDieName.name;
The first line sets the variable newDieName equal to the result of the prompt window
Since the prompt returns a string, the second line doesn't work. there is no "name" property of a string.
You can get rid of that second line all together since the first one already does what you want.