Duplicate and increment text

Hi
Never used Illustrator scripting bebore.
Could soeone please write me a script that takes as arguments.
text : a text element on the artwork (not sure if this is possible)
inX, incY : Incremental y co ordinate (x less impotant)
numOfSteps : Number of duplcates made
This script should then make duplicats of the text element and increment the number
So if I have a text box with the text '01'
And I enter <numOfSteps> 4, <inX> 0, <incY> 30. I would like 4 duplicates to be made spaced 30 pixels apart.
For example,
01       }
           } 30 pixels
02
03
04
05
It is imprtant the numbers are written in 2 digits 01 instead of just 1
An additional startNum variable would be very useful to state the number inside the first text field which the steps will be started from.
Hope this is even possible would save me a lot of time.
I'm good at actionscript so if it's written in that I could edit it, not that important though.
Thanks in advance,
Simon

Hello!
I'm new to scripting but i'm in a urgent need.
Ichanged this code obove to this below, but i have one problem that Ican't resolve.
Everything is good - the text is coppied and moved, but i need that the text is not moved to 0,0 ,but to stay where it was at the beggining - it is the most important.
Itried with it a coup;e of hours, so now i need help, please.
Below is the code i'm using:
#target illustrator
var selectedItems;
// if a document is open
if(documents.length >0)
    var idoc = app.activeDocument;  
   // if textframes exist in the document
   if(activeDocument.textFrames.length > 0)
      // check to make sure something is selected.
      selectedItems = selection
      if (selectedItems.length > 0)
            var itemFound = false;
            for(var i=0; i<selectedItems.length; i++)
               if(selectedItems[i].typename == "TextFrame")
                  itemFound = true;
                  var startNum = selectedItems[i].contents;
                  var incX = 300;
                  var steps = 6;
                  selectedItems[i].contents = startNum;
                  var myGroup = app.activeDocument.groupItems.add();
                  selectedItems[i].move( myGroup , ElementPlacement.PLACEAFTER);
                  selectedItems[i].position = [0,0];
                  for(var a=0; a<steps; a++)
                      selectedItems[i].duplicate ();
                      selectedItems[i].move( myGroup , ElementPlacement.PLACEAFTER);
                      var newNumber = parseFloat(startNum) + (a+1);
                      selectedItems[i].contents = newNumber;
                      var newX = incX / 72;
                      selectedItems[i].position = [((a+1)*incX),0];
            if(itemFound == false) alert("No text items are selected.");
      else
         alert("Nothing is selected, select a text item(s) or a text range.");
   else
      alert("Open a document and select 1 or more text items or a text range.");
else
   alert("Open a document and select 1 or more text items or a text range.");

Similar Messages

  • I'm trying to use Verizon Messages plus app but I my recipients receive duplicate or blank texts

    why is verizon messages+ sending duplicate and blank texts?

    Which form of the app does this - the phone app, the desktop app, or the web app?  Or all three??
    What phone do you have?  And if it's a smartphone, have ypu set the Messages + app to be the default texting app, and disabled the other text apps?

  • I want to duplicate and repeat a text box - up, down, left, right

    I inserted (and sized) a text box on a page.
    Now I want to duplicate and repeat the same size box over and over again in any direction.
    There must be a way....right?
      Mac OS X (10.4.9)  
      Mac OS X (10.4.9)  

    FN:
    Welcome to the Apple Discussions. Select the original box and type Command-D (duplicate). Move the copy to where you want. Then select the copy and type Command-D again. The next copy will be located in relation to copy 1 as copy 1 was to the original. Keep typing Command-D until you get the number you want.
    Do you Twango?

  • Read and write from and to text file

     Hi All,
    I am trying to read some portion of a text file and make measurement and calculation with those numbers and write back to the same text file and also to a excel file. I need to create a 2 D  array of 20 by 20 from the text file values and write to front panel table and to text file. but I am having problem with it, obviously I am new to this. Please help me.  thanks much
    ~ Johnny

    Hi Lynn,
    the requirement is to move C1 and C2 to each position that is given in the text file in steps and percentage value.
    for example C1 has to go to first step (5%) and C2 has to go thru all steps, 5% to 95% , in 5 percent increment. 
    each 100 steps translates to 1 percent increment in the capacitor value.
    at the end, I need to enter the measured data (values of C1 for each step, vesus all values of C2 for all steps) and enter them at the bottom of the text file's table where it starts at : "IMPEDANCE_REAL in Ohmone line per C1 position, containing all values for the different C2 positions" and do the same for where it says "IMPEDANCE_IMAGINARY in Ohmone line per C1 position, containing all values for the different C2 positions"
    the reason I read the file twice, is that if it read it once, I couldn't connect it to spreadsheet string to array vi.
    as you can see, I also like to use the write to measurement file and build table express vi's to display the table on the front panel and save the data to ni data file format so later I convert it to excel  too.
    any thoughts?
    thanks for your help
    ~ Johnny
    Attachments:
    read from text2.vi ‏82 KB

  • How is it possible to adjust the background images and the text in Mail?

    How is it possible to adjust the background images and the text in Mail?

    Here's the solution I used to solve the same problem. If you're not comfortable editing the source files, this might be more than you want to take on--but I've done it to several files with no ill effects. You can follow the instructions on this page and the referenced original post from (he includes a link on the page). Good luck! He's got some great tips on some of his other pages.
    http://photo.rwboyer.com/2010/03/15/aperture-3-book-theme-trick/
    A warning about editing the Master pages--it only edits them in that book--it doesn't update the theme. So if you go to create another book with those same layouts, you'll have to duplicate the book and replace all the images. An alternative would be to create a "clean" book with no photos in it and then just use that as a starting point each time.

  • Working with duplicates and combining files

    I'm new and trying to learn how to properly use Itunes. I am currently importing all my cd's onto an external drive (F Drive). Apparently after reboots ITunes sometimes imported the songs on the default C drive and not the F drive(which I did not realize until now). Now I know to change it back to the F drive when I reboot. My problem is that somehow I have copies of some of the albums on my C drive and some on the F drive as well as duplicates on both. Not sure what I did to get the duplicates. Here is my problem. For example, I have a folder of Brad Paisley on C drive that contains Mudd on the Tires, Time Well Wasted and Who Needs Pictures. On the F drive it only has Mudd on the Tires and Brad Paisley II. So I have one duplicate and one that wasn't on my C drive. I have a lot of folders in this manner. How do I go about getting ITunes to copy only the folders I need to transfer to the F drive? I did a try a couple and ITunes copied them and duplicated so many songs so now I have to go through them and delete them dups (which are hundreds!). I also tried to just drag them from C to F drive but it of course copies over the Brad Paisley folder and you lose some of the albums depending on which folder you pasted over. I was manually going through each folder and comparing them and dragging just the album to the F folder that was missing on the C drive. But this is taking forever. Is there a quicker way? Also is there a quick way to delete all the duplicates? And one more question, the F drive has most of my song with star ratings but the C drive does not have any star ratings. Is there a way to import and/or transfer the music without losing the star ratings I have? I'm working with about 10,000 songs so that is why these are such enormous tasks.
    Sorry for the long explination. I just wanted to make sure I was being clear on my question. I hope there is an easier way and that someone will share their knowledge. Thanks so much.
    P.S. Is there a book you suggest that will help me or is it best just to ask questions as they come up here? Thanks again.
    Self Built   Windows XP  

    Here is my code
    var imageURL:String = "vid12.SWF";
    var request:URLRequest = new URLRequest(imageURL);
    uiLoader.scaleContent = true;
    uiLoader.load(request);
    progressBar.source = uiLoader;
    progressBar.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    progressBar.addEventListener(Event.COMPLETE, completeHandler);
    function progressHandler (event:ProgressEvent):void {
    status_txt.text = int(event.currentTarget.percentComplete) + " %";
    function completeHandler (event:Event):void {
    progressBar.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
    progressBar.removeEventListener(Event.COMPLETE, completeHandler);
    removeChild(progressBar);
    status_txt.text = "";

  • How send e-mail with XML + PDF and body text

    Hi everyone,
    I have a new requirement but I´m with doubts, how to send an e-mail with two attachements (XML and PDF) and body text using -
    MIME: multipart/mixed;boundary
    I already have code to send XML + body text as you can see below:
    Element contentType = docout.createElement("Content_Type");
      root.appendChild(contentType);
      Text contentTypeText = docout.createTextNode("multipart/mixed;boundary=--AaZz");
      absTraceLog.addDebugMessage("Content_Type e-mail --- "+contentTypeText.toString());
      contentType.appendChild(contentTypeText)
    String text = "----AaZz\r\nContent-Type: text/plain; charset=UTF-8\r\n" +
            "Content-Disposition: inline\r\n\r\n" + nfeText +
            "\r\n----AaZz\r\nContent-Disposition: attachment; filename="+ prefixo +" "+ chaveNFe +".xml" +"\r\n\r\n" + xmlString + "\r\n";
    Element content = docout.createElement("Content");
    root.appendChild(content);
    contentText = docout.createTextNode(text);
    Content.appendChild(contentText);
    The code above work good, but I can´t duplicate any field from XiMail 3.0 - because it´s 0:1.
    So how to do that ?
    Thanks.
    Regards,
    BR.
    Viana.

    Eng,
    That´s works good with mailPackage:
                content= "--" + "--Zz" + CRLF
                        + "Content-Type: text/html; charset=UTF-8" + CRLF
                        + "Content-Disposition: inline" + CRLF + CRLF
                        + textBodyMail + CRLF
                        + "--" + "--Zz" + CRLF
                        + "Content-Type: application/xml; name=" + attachmentName + CRLF
                        + "Content-Disposition: attachment; filename=" + attachmentName + CRLF
                        + "Content-Transfer-Encoding: base64" + CRLF + CRLF
                        + encoder.encode(inputString.getBytes("UTF-8")) + CRLF
                        + "--" + "--Zz" + CRLF
                        + "Content-Type: application/pdf; name=" + pdfName + CRLF
                        + "Content-Disposition: attachment; filename=" + pdfName + CRLF
                        + "Content-Transfer-Encoding: base64" + CRLF + CRLF
                        + encoder.encodeBuffer(new BASE64Decoder().decodeBuffer(pdfAttachment));
    Regards,
    BR.
    Ricardo Viana.

  • Use VBA and Excel to open Dreamweaver HTML (CS5), find and replace text, save and close

    I wish to use VBA and Excel to programmatically open numbered Dreamweaver HTML (CS5) and find and replace text in the code view of these files, save and close them.
    I have  5000 associations between Find: x0001 and Replace: y0001 in an Excel sheet.
    I have the VBA written but do not know how to open, close and save the code view of the ####.html files. Please ... and thank you...
    [email protected]

    This is actually the code view of file ####.html that I wish to find and replace programmatically where #### is a four digit number cataloguing each painting.... In 1995 I thought this was clever... maybe not so clever now :>)) Thank you for whatever you can do Rob!
    !####.jpg!
    h2. "Name####"
    Oils on acrylic foundation commercial canvas - . xx X xx (inches) Started
    Back of the Painting In Progress </p> </body> </html>
    Warmest regards,
    Phil the Forecaster, http://philtheforecaster.blogspot.ca/ and http://phils-market.blogspot.ca/

  • My new icloud acct on my imac is duplicating entries in calendar from my ipad; how do I get rid of the duplicates and how do I get one calendar to be the main one to start with

    I've just installed Mavericks on my iMac and now my calendar has duplicate and now sometimes tripled events by syncing with my ipad mini regardless of whether the item already existed in the iMac calendar already. How do I remove the duplicates? It was being able to sync calendars and contacts which was one of my reasons for moving from Snow Leopard to Mavericks and now it's a mess.

    Crista70, What is happening is you now have 2 calendars with the entries in them. If you go into View, then Show Calendar List, you will see all your calendars. Uncheck the ones listed as "From My Mac" or uncheck the ones listed as "iCloud" and they will no longer show as duplicates. Personally, I prefer unchecking the "From My Mac" calendars so that my calendars are all synced across the devices.

  • I have an iphone 4s and the text i send to a friend with a galaxy 4s he is not receiving any help?

    i have an Iphone 4S and the text i send to a friend with a galaxy 4s he is not receiving. Any help?

    Then it's sending as SMS and not iMessage (that's good) so deleting the contact probably didn't help. It also seems iMessage isn't redirecting his texts as he's not used and apple device on the account previously. Can he receive a picture message from you instead? Does he receive texts from other  apple devices? (iPhones,pods/pads) try sending a text through Verizon online using your account on a web browser. If it is also blocked then it confirms the issue is with his device, well at least points you there rather than guessing if it's yours or his or both. There's some ideas, let me know- Joe
    Sent from my iPhone

  • HT4623 my iPhone can call out and receive text messages and emails but is not receiving any incoming calls

    my Iphone can call ut and receive text/email messages but is not receiving incoming calls.  What is your thought?

    Hi Baileyfour,
    Welcome to the Support Communities!
    The articles below may be able to help you with this issue.
    Click on the link to see more details and screenshots. 
    iPhone: Can't hear through the receiver or speakers
    http://support.apple.com/kb/TS1630
    There are two places where vibrations can be set.
    One is the Settings > Sounds
    The other area is Settings > Notifications
    If you have an app set to Alert, it may have a vibration set for it.
    iOS: Understanding Notifications
    http://support.apple.com/kb/ht3576
    Information about Notifications settings can also be found in the iPhone User Guide (pages 131, 132)
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
    I hope this information helps ....
    Have a great day!
    - Judy

  • Anchor tag error, also copy and pasting text comes up "null"

    After the recent update I am receiving anchor tag errors telling me to start with an alphabetic letter, which I was. Also no longer lets me copy and paste text onto a page, instead it says "null". Any ideas on a fix ?

    I don't see a closing </body> tag in your code.  There's an opening tag, but no closing tag, hence unbalanced.
    ^_^

  • My iphone 4S stopped receiving and sending text messges. Help!

    My iphone 4S stopped receiving and sending text messges. Help!

    Hi J.A. Curie!
    Here is an article that can help you troubleshoot this issue:
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • Difference in a string and the text retrieved from JTextBox

    Hello,
    I am facing a peculiar problem. Please see the following code fragment:
    m.replaceAll(";\ngo;);
    where m is a matcher. This is working fine. But whenever I am doing
    m.replaceAll(myTextBox.getText());
    and placing ";\ngo;" in the text Field is not working as before. This is because that getText() returns a string in text form(doesnot take the newline into consideration). Any idea how to solve this?
    Regards,
    Saurav

    Here is the following code:
    File fin = new File(file);
    File fout = new File("C:\\Temp\\temp123.txt");
    FileInputStream fis = new FileInputStream(fin);
    FileOutputStream fos = new FileOutputStream(fout);
    BufferedReader in = new BufferedReader(new InputStreamReader(fis));
    BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos));
    Pattern p = Pattern.compile(find);
    Matcher m = p.matcher("");
    String aLine = null;
    while((aLine = in.readLine()) != null) {
    m.reset(aLine);
    String result = m.replaceAll(replace);
    out.write(result);
    out.newLine();
    in.close();
    out.close();
    What I intend to do is that the user will provide a fileName from the GUI and also the text to find and the text to repalce with. Both of them will be in a JTextBox. Now
    suppose I want to replace ";" in the line "Hello;" with ";\nHow are u?" so that the line looks like
    "Hello;
    How are u?"
    But what is happening is that the line looks like
    "Hello;\nHow are u?" after replacement.
    This happens because getText() doesnot considers that as a special character...
    I tried to harcode the replace string and it worked perfectly....
    Thats the problem.....I need the same behaviour with getText().
    Regards,
    Saurav

  • Sending Email using both HTML and plain text

    I could use some advise on how to start researching email for
    both HTML and plain text messages.
    I have a script called class.phpMail.php, but the code is
    alittle advanced for me. Basically I can't get
    it to work on my server and I don't know where to begin the
    learning process here.
    I talked to my provider, "HOST" company goDaddy.com and I was
    told that to connect so that I could send email I would need this
    line of code. They didn't say it should by in my php.ini file but
    that was where I found it.
    SMTP = relay-hosting.secureserver.net
    This is the smtp address that my provider uses to make the
    connection with my mail client.
    I was told that with this line of code I would not need a
    password or username
    I did some further reseach and I found an article that stated
    that my original error:
    Warning: fsockopen() expects parameter 2 to be long, string
    given in ...../php/class.smtp.php on line 105
    was being caused by this code because the $port value needed
    to be between 1 - 65365:
    $this->smtp_conn = fsockopen($host, # the host of the server
    $port, # the port to use ----- "this is line 105"
    $errno, # error number if any
    $errstr, # error message if any
    $tval); # give up after ? secs
    In particular the $port value was coming in corrupted and
    that I needed to cast it.
    I did as they suggested and made it an (int) as they
    suggested.
    $this->smtp_conn = fsockopen($host, # the host of the server
    (int)$port, # the port to use
    $errno, # error number if any
    $errstr, # error message if any
    $tval); # give up after ? secs
    It resolved part of the error message however, the other half
    of the error message is shown below:
    Message could not be sent.
    Mailer Error: Language string failed to load: connect_host
    What exactly is the connect_host they refer to in this
    message?
    Would it be the string in my php.ini file refering to the
    SMTP = relay-hosting.secureserver.net
    I have allot of what I think are disconnected questions as I
    really have just begun to work
    with the mail() function. If anyone has the time to educate
    this newbie into the wonderful
    world of email() I would appreciate it.
    Thank You
    Kevin Raleigh

    Sorry to dig up an old post, but we've spent the last few days trying to work out why an email campaign being sent from BC is going into the Junk folder of recipients that use MS Exchange. We've fixed quite a lot of issues, including the fact that Legacy Templates have random JS injected just before they get sent, so we had to switch to the new template system. We've narrowed the issue down to one of three things:
    1. A missing alt tag on the tracking image that BC drops into the email (pretty unlikely)
    2. The BC Europe IP (54.240.14.45) is blacklisted here: UCEPROTECTL2 (possible, but if you actually look it's not the IP itself, but another IP on the same network, so unlikely)
    3. The fact that the HTML email has no text component.
    I agree, BC is late on this but I think that it needs to be added, even if most users have HTML-ready email clients, spam checkers do seem to prefer multi-MIME emails.
    This is backed up by the following SpamAssassin rule, which we are currently unable to resolve:
    -1.105
    MIME_HTML_ONLY
    Message only has text/html MIME parts
    You should also include a text version of your message (text/plain)
    So in my opinion, BC do still need to add this as a feature, otherwise the system is not viable for our customers and we'll have to look elsewhere.

Maybe you are looking for

  • Sorry but... the basics

    Sorry to bother you but i am new to JSP development and more to Web development. Just a complete and simple answer would satisfy me. How is it possible when any user presses the submit button from an html form in .JSP to execute an SQL statement to c

  • Low memory space

    Hi experts , while working on a program i am facing runtime error of low memory space . can u help me on this. thanks & regards

  • Centered flash site with no margins

    I was wondering if any one could help me in "coding" my site to have my flash page be centered and have NO margins.... I know Kirupa.com had a code on his site in regards to some code to be placed in the "head" tag of the .html "page" but it has sinc

  • GR/IR not cleared Error

    Hi Guys, while doing GR/IR clearing for certain documents,we are getting error. The error log says " No clearing procedures were carried out " Please advise.. thanks srikanth..

  • IPhone 3g photos screwy when emailed

    Twice while preparing to email a photo from iPhone photo library the selected photo will appear to have been sliced lengthwise, one part lowered, and the bottom part placed up at the top. Does this make sense? Result is a picture that looks more like