Need help subscripting in a text layer

Hi.  I need some help getting the Java Script right for subscripting in a text layer.
Specifically, I need to access the text in layers named "Formula1" "Formula2" thru "Formula6", find each number in the text and subscript it.
I actually want to set the baseline for that character to -3
I usually write code in VBA, and JavaScript is winning the battle!  I need Java so I can share it with someone on a mac. 
Ideas?  Help?  I'll take em!  Thanks!

As others have said, to change the format of just some of the chars in a textItem can only be done with Action Manager. On Windows you can use javascript or VB. On Mac you can only use javascript.
A textItem's descriptor has 10 keys. The one controls that kind of char formatting is stored in the 'textStyleRange' key. That one descriptor has 69 keys that store the formatting for that range. There may be several ranges.. Some of the keys in 'textStyleRange'  are also descriptors that have their own keys. To avoid unwanted changes to the existing formatting you need to read all those keys, change only the 'baselineShift' key in the 'textStyleRange' descriptor, then write all the settings back to the textItem's descriptor.
It may be that it is possible to do this kind of format editing with a script but it would take a lot of work and many, many line of code. It also would take a good understanding of how Action Manager works with it's actionDescriptors, actionReferences, actionLists, and their methods and properties.
It has been a good while since I looked at Xbytor's script, but when I last looked it only supports limited formatting and overwrites existing formatting it doesn't support with default text formatting. If your text doesn't have any special formatting his script would be the best way to go.
If your text does have formatting unsported by X's script you will either need to expand his script or create your own. Unless this kind of text editing is something that you need to do very often it may not be worth the effort.

Similar Messages

  • I need help deleting and adding text

    i need help deleting and adding text, can soneone help
    Adobe Photoshop Elements 10

    You should delete your phone number from the topic line.
    Spambots search these forums for contact info.
    You don't want to get even more telemarketing/scam calls than you probably already get.
    It seems like the "Do Not Call" lists are ignored these days.
    Message was edited by: Bo LeBeau       Looks like someone already took care of this.

  • Help to create a text layer using scripting

    Hello everyone.
    I want to create a image as above.
    I know the box's left top point coordinate and the box's width and height. How can i create this layer ?
    I am using the following code, but it seems incorrect.
    app.documents.add(2175,1575, 300);
    var FontName = "BouwsmaText";
    var FontSize = 11;
    var black = new SolidColor();
    black.rgb.hexValue = '000000';
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.POINTS;
    var newTextLayer = activeDocument.artLayers.add();
    newTextLayer.kind = LayerKind.TEXT;
    newTextLayer.textItem.kind = TextType.POINTTEXT;
    newTextLayer.textItem.color = black;
    newTextLayer.textItem.font = FontName;
    newTextLayer.textItem.size = FontSize;
    newTextLayer.textItem.contents = "Hello world\rThank you very much";
    newTextLayer.textItem.position = [new UnitValue(50, 'px'), new UnitValue(80, 'px')];
    newTextLayer.textItem.justification=Justification.CENTER;
    I don't know how to set the box's width and height. if I use TextType.PARAGRAPHTEXT, the width and height and coordinate are incorrect. Please help me , Thanks!

    If you do not add the text layer as paragraph text it is very easy to align the text to a selection. Make the selection after adding the text to the top left cornor of your document as a single or multiline text layer the use align layer to selection(scriptlistener code).  Paul has posted code in this forum you can steal like I did for aligning layers to a selection. For example
    //                              Helper Functions                                                  //
    function align(method) {
              var desc = new ActionDescriptor();
              var ref = new ActionReference();
              ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
              desc.putReference( charIDToTypeID( "null" ), ref );
              desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );
              try{
                        executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );
              }catch(e){}
    // In the main line I used it like this with other code Paul posted
    // Add Filename Text if called for
    if ( PopCollage.msgPnl.StampImage.st.value) {
    stampFilename(textFont,textSizeFactor,textColor,Name);
    loadAlpha("Image " + imageNumber);
    var Position = Number(PopCollage.msgPnl.grp5a.dd1.selection.index) + 1;
    switch (Position){
    case 1 : align('AdLf'); align('AdTp'); break;
    case 2 : align('AdCH'); align('AdTp');break;
    case 3 : align('AdRg'); align('AdTp'); break
    case 4 : align('AdLf'); align('AdCV'); break;
    case 5 : align('AdCH'); align('AdCV');activeDocument.selection.deselect();activeDocument.activeLayer.rotate(textA ngle); break;
    case 6 : align('AdRg'); align('AdCV'); break;
    case 7 : align('AdLf'); align('AdBt'); break;
    case 8 : align('AdCH'); align('AdBt'); break;
    case 9 : align('AdRg'); align('AdBt'); break;
    default : break;
    activeDocument.selection.deselect();
    // Add text Layer's layer style
    addStyle(textStyle);
    }  //end if

  • I need help with my wifi text. I can't use them

    I need help with my iPhone 4. I can't text since. I get wifi in my house ?

    What is the make & model of the wireless router that you are trying to extend with the WN3000RP? Can any other wireless clients connect to the extended network, just not your iMac?

  • Need Help with Timeline Setup, Text won't show up in SWF

    I am creating a site for one of my company's restaurants, and I have all of my pages created in flash. I have not done any Actionscript on any of the pages yet. I thought that I would just be able to create each page and take the swf files and import them into a main index page on the timeline and code from there. However, when I imported my .swf files to the library of the main flash file, none of my text showed up at all. I have added the fonts to my library and I tried breaking apart the text, but nothing has worked.
    Also, I don't know how exactly to set up the timeline to link all of my pages, and I have looked in other forums and have seen people reference the online help, but I do not know where to find that!
    I am a mess right now, the site needs to be up by Friday!! PLEASE HELP!

    So I have created all new movie clips in my index.fla file by copying all of my files from another file and pasting them into the movie clip  timeline. I have placed all of my new movie clips in different layers on the index timeline, and have created keyframes 10 frames apart. I have my actions layer with frame labels for each page every ten frames (i.e. tbLabel is at frame 1 in my actions layer and the movie clip is on a different layer at frame one, restaurantLabel is at frame 10 in my actions layer and the movie clip for that page is on a different layer at frame ten, all the way up to frame 120). I haven't put any actionscript in my movieclips except for stop(); at the end of each file. My current actionscript, placed in frame 1 for my first page when the viewer goes to the site is as follows:
    thunderBayBtn.addEventListener(MouseEvent.CLICK, goIndex);
    restaurantBtn.addEventListener(MouseEvent.CLICK, goRestaurant);
    birchBtn.addEventListener(MouseEvent.CLICK, goBirch);
    menuBtn.addEventListener(MouseEvent.CLICK, goMenu);
    eventBtn.addEventListener(MouseEvent.CLICK, goEventLand);
    davEventBtn.addEventListener(MouseEvent.CLICK, goDavEvent);
    rockEventBtn.addEventListener(MouseEvent.CLICK, goRockEvent);
    pewEventBtn.addEventListener(MouseEvent.CLICK, goPewEvent);
    pewEventBtn.addEventListener(MouseEvent.CLICK, goPewEvent);
    giftBtn.addEventListener(MouseEvent.CLICK, goGiftCert);
    downloadBtn.addEventListener(MouseEvent.CLICK, goDownload);
    contestBtn.addEventListener(MouseEvent.CLICK, goContestLand);
    davContestBtn.addEventListener(MouseEvent.CLICK, goDavContest);
    rockPewContestBtn.addEventListener(MouseEvent.CLICK, goRockPewContest);
    function goIndex(event:MouseEvent):void
                gotoAndPlay(1);
    function goRestaurant(event:MouseEvent):void
                gotoAndPlay(10);
    function goBirch(event:MouseEvent):void
                gotoAndPlay(20);
    function goMenu(event:MouseEvent):void
                gotoAndPlay(30);
    function goEventLand(event:MouseEvent):void
                gotoAndPlay(40);
    function goDavEvent(event:MouseEvent):void
                gotoAndPlay(50);
    function goRockEvent(event:MouseEvent):void
                gotoAndPlay(50);
    function goPewEvent(event:MouseEvent):void
                gotoAndPlay(50);
    function goGiftCert(event:MouseEvent):void
                gotoAndPlay(90);
    function goDownload(event:MouseEvent):void
                gotoAndPlay(100);
    function goContestLand(event:MouseEvent):void
                gotoAndPlay(110);
    function goDavContest(event:MouseEvent):void
                gotoAndPlay(120);
    function goRockPewContest(event:MouseEvent):void
                gotoAndPlay(120);
    However, when I go to test the movie, I get "1120 access" errors even though the buttons are named in the properties pane, however, I cannot view that in the file that conatins all of my movie clips because they are movie clips.
    Also, When I go to view the movie with all of my movie clips, all of them play one on top of the other, none of them stop, and the buttons do not work.
    I'm having a hard time figuring out what actionscript I need to use and where!

  • Need help in searching a text

    I am develping an JAVA application which will query the database and retrieve a text set. I need to know how i shld retrieve an exact line from it which i am sure will be present in the result set.
    (eg) If my query returns the following text,
    "Let us define some important terms related to Systems & software.
    A system consists of people, machines or technology, and methods or processes, organized to accomplish a set of specific functions.The total man hours needed for this is 22hrs."
    I want to get only the line "The total man hours needed for this is 22hrs" and display on screen.But the 22 hrs will change to anything depending upon the query . I need to take a sentence which starts like "The total man hours needed for this is ....."
    I tried using 'like %'.............But it gives the entire text as the result which is not desired.
    Help me out.

    Why do you want to do that in the database? You asked the question on a Java forum, so I will give you a Java answer. Use String.indexOf and String.substring or regular expressions to get the part that you want.
    Kaj

  • Need help - script to continue text in another field if necessary

    Wish I could attach my form but it's not available. I am using Adobe Acrobat 9.0. I have a form with two text fields for "Other" information that needs to be shared. If the user types in more characters than the box holds the overflow text doesn't print. These are court documents and all the text has to print somehow. I am trying to figure out a work around for this and wondered if a script can be written to put the extra text from each "Other" field into another field that would open on a new page at the end of the document if necessary. I want to avoid having extra empty pages however so if they can be added ONLY if the text needs to overflow. I hope I explained this okay, like I said I wanted to upload the form but can't. If someone can help me with this I would really appreciate it.

    LiveCycle is a part of Acrobat Pro Extended - Windows users only, not Mac.
    OctRita wrote:
    … would it be possible to have a page at the end with a text field for each of the ones that need overflow to print and can a javascript be written to put the extra text into those fields?
    Yes, it is possible - I've already indirectly provided you with the code for that via the link in my post. Just remember to save it to your desktop:
    http://www.adirect.dk/adobeforum/commentfields.pdf
    As an alternative you could remove the limited characters, set the field to multiline and make a script that set the textsize to auto if the user fills the field with text. When textsize is set to auto, the text will keep on shrinking as user types more text.
    Torben.

  • Need help with adding formatted text and images to Crystal Report?

    Here's my scenario:
    I have a customer statement that's generated as a crystal report and that has a placeholder for advertisement. The advertisement is mixture of formatted text and images. Until now we only had one advertisement that was always used on the report. The new requirement is that we would have a pool of hundreds of advertisements and would need to display one specific advertisement on the customer statement based on various marketing criteria. They key is that the advertisement content will be determined programmatically and cannot be hardcoded into the report. I'm using Crystal2008 with .net SDK.
    Here are the solutions I thought of, but I'm still rather lost and would appreciate your help/opinion.
    1) Pass HTML or RTF to the report
    Not really sure if this is possible and how to get it done. Also how would I pass in images? Would display formatting be reliable when exporting to PDF?
    2) Create each add as a subreport and append it programatically
    I actually have this working, but I only know how to append a new section to the end of the report and then load the subreport to the section. I have no other controll of the placement. Is there a way to dynamically load a subreport to a predefined section in the main report? How about adding a dummy subreport in the main report as a placeholder and then replacing it with a different subreport? How could I do this?
    3) Pass an Image to the report
    I would create each advertisement as an image and then would somehow add the image to the report. How would I load the image and control the placement? Could I somehow define a placeholder for the image in the main report-maybe a dummy image to be replaced?
    Thank you.

    Hello Pavel,
    I would got the third way.
    You can use dynamic images in your report.
    Just by changing the URL to the image the image can be changed.
    Please see the [Crystal Manual|http://help.sap.com/businessobject/product_guides/cr2008/en/xir3_cr_usergde_en.pdf] and search for images.
    or directly here
    [Setting a Dynamic Graphic Location Path on an Image Object|https://boc.sdn.sap.com/node/506]
    [Dynamic image and HTTP://|https://boc.sdn.sap.com/node/3646]
    [codesample for .NET|https://boc.sdn.sap.com/node/6000]
    Please also use
    [Crystal Reports 2008 SDK Documentation and Sample Code|https://boc.sdn.sap.com/developer/library/CR2008SDK]
    [Crystal Reports 2008 .NET SDK Tutorial Samples|https://boc.sdn.sap.com/node/6203]
    Hope this helps
    Falk

  • Need help displaying data in text field... Help?

    i have this code:
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import com.adobe.serialization.json.JSON;
    var loader:URLLoader = new URLLoader(new URLRequest("https://api.twitter.com/1/statuses/user_timeline.json?screen_name=ScottMitchell"));
    loader.addEventListener(Event.COMPLETE, loadComplete);
    function loadComplete(e:Event):void {
        processData(e.target.data);
    function processData(data:String):void {
        var tweets:Array = JSON.decode(data) as Array;
        trace(tweets[0].text);
    It works, in the output it tells me the tweets.
    but i need it to be displyed on the app, i need to no how to do this, someone pointed me in the direction of using a item renderer extended from sprite?
    But really all i need to do is display it in a text field, all i want to do is display the data.
    Can anyone help???
    I know this is probably simple and i did try to figure this out on my own, but had no luck.
    All help is appreciated.
    Many thanks in advance.

    you can always use an array if there's no pattern to your positions:
    var positionA:Array=[ [100,20], [2,222], [55,2], [201,111], [78,23] ];
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import com.adobe.serialization.json.JSON;
    var loader:URLLoader = new URLLoader(new URLRequest("https://api.twitter.com/1/statuses/user_timeline.json?screen_name=ScottMitchell"));
    loader.addEventListener(Event.COMPLETE, loadComplete);
    function loadComplete(e:Event):void {
        processData(e.target.data);
    function processData(data:String):void {
        var tweets:Array = JSON.decode(data) as Array;
    for(var i:int=0;i<5;i++){
    var tf:TextField=new TextField();
    addChild(tf);
    tf.multiline=true;
    tf.width=300;
    tf.text =   tweets[i].text;
    tf.autoSize="left";
    tf.x=positionA[i][0];
    tf.y=positionA[i][1];
    nextY+=tf.height;

  • I Need help wrapping an expandable text field to the next page, while pushing a subforum beneath it

    Hi, I hope I can get some help with this form that I am desperately trying to finish.
    I am unable to get an expandable text field to recognize both 1.) the positioned subforum underneath and 2.) the page break. I'll attach the file if it helps get an understanding of what I mean, and maybe someone can see what I did to royally screw it up. The area of the form in question is on page 4 of the attached document. I want the user to be able to write as much as they need in the summary section, and still fill out the last section afterwards.
    If more info is needed, let me know and I will do my best to describe what I did. My last solution I tried, before giving up, was to wrap the previous section, as well as the next section of the expandable text field, into its own subforum. Then, I nested the subforums together in another subforum.
    Thanks in advance.
    -Joshua
    Attachment Link:
    https://docs.google.com/open?id=0B2iKKEocs4_gTTlwZEpHTWxZVkE

    In case anyone sifting through forums, looking for the answer to this question, needs the answer: paulk07 was able to fix my document by unwrapping all of the subforms on the last page and then wrapping it in only 3 subforms (2 positioned/1 flowed) and then set the page to flow.
    From there, I set the margins so when the sectioned wrapped to a new page, it didn't end/begin at the edge of the page.
    Thanks again paulk07

  • Need help with actively replacing text in SVG

    I am new to Dreamweaver, Illustrator and SVG.  Also, I do have a firm understanding of HTML but limited knowledge of Javascript and other languages.  I am trying to create a website where the user is able to type in a form field (or something to that extent) and have the text in a displayed SVG be updated with the typed text.  I've done extensive searching on the subject and come up with nothing that seems to work.  Nor do I seem to be able to make it work.
    I found a dead tutorial on the Adobe website which might help illustrate what I am trying to achieve:
    http://www.adobe.com/svg/basics/text.html
    ANY help would be GREATLY appreciated.
    Thank you
    Adam

    Select the text. Copy to Clipboard. Open TextEdit. Paste. Resize its window appropriately. Choose Print off its File menu. Done.

  • Need help with a typewriter text effect

    Hi, could you guys look over my script and see what's up? I'd like the words in the string to type out in the alotted time, but for some reason my function apends the first and last letter of anything in the string, so "Hello?" becomes "ello." This is not affected if I pad the text in the string with spaces, i.e. " Hello? " Nor does this work if I start count i at -1, not 0. Please help.
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    var str:String = "Hello?";
    var i:int = -1;
    var delay:int = 720%str.length;
    var timer:Timer = new Timer(delay);
    timer.start();
    timer.addEventListener(TimerEvent.TIMER,gotime);
    function gotime(e:TimerEvent)
    textbox_txt.appendText(str.charAt(i));
    i++;
    if (i>=str.length)
    timer.stop();

    AHA!  If forgot to go into the properties of my textfield and tell the ebedded font to have a character range of "All."
    Thanks for getting my brain going Ned!
    -Ab Infinito

  • Need help...retrieving text from html

    i have successfully convert my text into html... however, i have problem restoring the html back to text...
    below is my html:
    <html>
    <head>
    <style> <!-- p.default { italic:; size:3; bold:normal; family:Times New Roman; foreground:#000000; } --> </style>
    </head>
    <body> <p class=default>
    <span style="color: #000000; font-size: 72pt; font-family: Times New Roman"> <u><i><b>HELLO WORLD</b></i></u>
    </span>
    </p>
    </body>
    </html>
    this is the method i used to restore the text:
    String htmlInString=CustomPanel.getHTML();
    JTextPane p=new JTextPane(new HTMLDocument());
    p.setContentType("text/html");
    jPanel4.add(p);
    p.setText(htmlInString);
    the problem is, when i restore the text, i can only get the text,its bold,underline and italic... my font and font size are unable to be restored...
    for example, based on the html i provided above, it should come up with "HELLO WORLD", bold, underline and italic with the font size 72... but when i restored, my font size and font are not as it is stated in the html... why is this so????

    Try this ..
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.html.HTMLEditorKit;
    public class HtmlText extends JFrame {
         JTextPane m_area;
         public HtmlText(){
         m_area = new JTextPane();
         HTMLEditorKit kit = new HTMLEditorKit();
         m_area.setEditorKit(kit);
         JButton m_btn = new JButton("Show Text");      
         m_btn.addActionListener(new ActionListener(){
         public void actionPerformed(ActionEvent e){
              System.out.println("Html :-");
              System.out.println(m_area.getText());                                    
              System.out.println("Text :-");
              try{
              System.out.println(m_area.getDocument().getText(0,m_area.getDocument().getLength()));
              }catch (BadLocationException ee){
                   System.out.println("Exception " + ee.toString());
              JScrollPane m_scrollPane = new JScrollPane();
              m_scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
         m_scrollPane.getViewport().add( m_area );
              getContentPane().add( m_scrollPane, BorderLayout.CENTER );
              getContentPane().add( m_btn, BorderLayout.SOUTH );                    
         public static void main(String[] args) {
              HtmlText ht = new HtmlText();
              ht.setBounds(30,30,400,400);
              ht.setTitle("Html Text");
              ht.show();          

  • Need help Loading parsed RSS text

    Hi, I have created an AS3 FLA where I am parsing and
    displaying RSS text. I have traced the parsed text and displayed
    the text into dynamic text boxes on the stage no problem.
    However the line breaks in the traced text show up on stage
    as well.
    How does one strip out the <p> or </r> tags from
    the text to make the text one nice long line that will wrap using
    the length of the text box as it's parameters?

    OK, I have found the answer, thanks all.
    var myvar:String = myDynamicText.text;
    myDynamicText.text = myvar.split("\r").join(" ");
    myDynamicText.text = myDynamicText.text.split("\n").join("

  • Need help with Soundboard, trying to layer tracks.

    Hi, I’m a games design student from the UK I’m currently working on a music project. for this I want to create a soundboard where the user can select a multiple number of files and then play them as one track, my plan is to record background, rhythm, melody and random event tracks and have the user select one of these elements from each bank of samples and have a button for them to hear the outcome.
    So far i can get the soundboard elements to work, but no matter where i look or who i ask no one seems to know how to make this idea work, someone suggested using an array but when i started looking at arrays there seems to tutorials on creating them but not implementing them.
    any help, suggestions or links would be greatly received and appreciated.
    I also apologies if this has been covered before.
    It might also be helpful to know that I know some coding so working in action script (as I expect I must) is no really issue, but work primarily in 3D, so my knowledge of flash is at the novice level.
    Rich.

    Yes, you can use arrays as a mechanism for organizing the sound files, but that's just one small part of the problem. Here's a link to a tutorial that does, at least some, of what you're after: http://www.learningactionscript3.com/2007/12/06/sound-mixer-source/

Maybe you are looking for

  • How to change the size of the scrollbar in JScrollPane?

    I set a jtable in the jscrollpane,but the table is very small,so I want to change the size of the scrollbar in the jscrollpane.How can i do?Please help me,Thanks.

  • Installation of solaris 10

    Hi. Just trying to work my way through installing solaris 10. Never used solaris, unix or linux so please excuse my ignorance. When I boot from my dvd drive I am getting "not a ufs file system" message. I usually run xp however even when I have an un

  • Adobe Photoshop CC 2014 dejó de funcionar

    Instalé la versión de prueba de Photoshop pero al momento de abrir el programa me sale el siguiente mensaje: Adobe Photoshop CC 2014 dejó de funcionar, grac

  • FK's indexes : really necessary ?

    Hi all, I have a database with an index for each Foreign Key. This leads me to wonder whether theses indexes are really necessary ? I read elsewhere that a query like this one would help me to see which indexes are really worth it (the bigger the rat

  • N97 Music Player Keeps On Refreshing

    I recently updated my N97 V.20 and the phone is way better than before.. I have problem in my music player when i copy files on my internal 32GB memory and refresh the library it keeps on refreshing then i have to remove battery. When i on the phone