Scripting with text

Hello. I have a few simple things that I want to know how to do in Illustrator with Java script so that I can easily automate it. I have looked at examples of scripts but most are too large and doing too many things for me to understand. If you can answer any one of these please do so.
1) How to determine the font size of text without having text selected? All fonts in my files should be the same size so this may require just testing the first text found, possibly by just scrolling through all of the objects until text is found. I would like to have the font size to be set to a variable that I can use it later.
2) How to set all text in document to a given font size and type? Let's say Helvetica, 6pt.
3) How to convert all text to black? I have some files that begin with gray text but I would like to take a whole document, scroll through each text and convert them all to black.
2) How to select everything and transform-scale? I would like to know how to scale with and without strokes and effects in script.
4) How to select everything and center it both horizontally and vertically?
6) How to insert the file name without extension and put into bottom right corner?
7) How to embed an unopened file and put into bottom left corner?
8) How to add a stroke of 1 px to inside edge of document?
Thanks for any help you can give.

This is probably NOT the fastest of methods of dealing with text but should be the easiest to understand… Should get you started.
#target illustrator
var docRef = app.activeDocument;
with (docRef) {
// Get a swatches color object by name
var myColor = swatches.getByName('Black').color;
// Get a text font object by name
var myFont = textFonts.getByName('Helvetica');
// Loop thru stories
for (var i = 0; i < stories.length; i++) {
// Then loop thru characters
for (var j = 0; j < stories[i].characters.length; j++) {
// Change character Attributes
stories[i].characters[j].characterAttributes.size = 6;
stories[i].characters[j].characterAttributes.fillColor = myColor;
stories[i].characters[j].characterAttributes.textFont = myFont;

Similar Messages

  • Issue with 'text box' in rtf sub template for peoplesoft XMLP

    Hi all,
    i have a weired problem using 'text Box' in a sub template. I am calling a sub template from my template. In my Sub template i have a text box ( i am using text box bcoz i want to justify the text not to the page margin but starting from a specific column.not sure if there is any other way with which i can do the same !!) . When i process the report (using application engine program) i get the below error
    Message Log entry:
    [052311_071441208][oracle.apps.xdo.common.xml.XSLTWrapper][ERROR] XSL error:
    psxmlp://SUB_BMX2<Line 63, Column 191>: XML-22031: (Error) Variable not defined: '_MR'.
    @Line 63 ==> </xsl:stylesheet>
    [052311_071441216][oracle.apps.xdo.template.FOProcessor][EXCEPTION] java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:618)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at com.peoplesoft.pt.xmlpublisher.PTFOProcessor.generateOutput(PTFOProcessor.java:74)
    Caused by: oracle.xdo.parser.v2.XPathException: Variable not defined: '_MR'.
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1534)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:521)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
         ... 13 more
    [052311_071441218][oracle.apps.xdo.template.FOProcessor][ERROR] End Memory: max=64MB, total=11MB, free=1MB
    PeopleTools 8.49.27 - Application Engine
    Copyright (c) 1988-2011 PeopleSoft, Inc.
    All Rights Reserved
    Processing started
    data extraction for EMPLID:1000646332 EMPL_RCD:0 EFFDT:2009-12-28 and EFFSEQ:6
    CFilem::LoadDefn(RDCRHIUTEECKNDZN2SPSRQ) : read 1 chunks
    UnchunkStuff : read 1 chunks for nCharDataLen 10520 chars
    CFilem::LoadDefn(RDCRHIUTEECKNDZN2SPSRQ) : after decode & decompress: 35330 bytes
    Calling XMLP
    Processing Report Defn:TR_BMX2
    Error Executing XMLP.Error generating report output: (235,2309) PSXP_RPTDEFNMANAGER.ReportDefn.OnExecute Name:ProcessReport PCPC:51952 Statement:1163
    Called from:TR_LATAM_CONTRACTS.ContractsXML.OnExecute Name:ExecuteXmlp Statement:16
    Called from:TR_LAMCNTRCT.MAIN.GBL.default.1900-01-01.Step04.OnExecute Statement:20
    Process 442706 ABENDED at Step TR_LAMCNTRCT.MAIN.Step04 (PeopleCode) -- RC = 22 (108,524)
    Process %s ABENDED at Step %s.%s.%s (Action %s) -- RC = %s
    It works fine when i remove the text box from my sub template. I tried to put the text box directly in the main template and it worked fine !! it is erroring out only when i use the text box in sub template !!
    Template file:
    <?import:psxmlp://SUB_BMX2?>
    <?choose:?>
    <?when: .//LETTER_CD=”PA4”?>
    <?call: BA101?>
    <?end when?>
    <?otherwise:?>
    Invalid Letter Code. No Sub Template Call defined for this Letter Code.
    <?end otherwise?>
    <?end choose?>
    Sub Template:
    <?template:BA101?>
    Testing without text box.
    Testing with text box
    there is a text box with text here .. cannot be copied from word !!
    <?end template?>
    i got the below error when i tried to 'preview' the report from my report definition.
    Error generating the report output: During calling method PTFOProcessor.generateOutput, the XDO engine throws an exception:NULL. (235,3101) (235,2309)
    Error occurred during the process of generating the output file from template file, XML file, and the translation XLIFF file.
    Any help would be greatly appreciated.
    Edited by: Naveen Kumar on May 23, 2011 4:31 AM

    misunderstood =/
    Original (Coming - output):  "<PAY_TXT>PAYκ Contact your bank or financial institution to make this payment from your cheque, savings, debit or transaction account.</PAY_TXT>"
    it's in output but what is data in database ?
    sorry but without knowing about source data for forming the xml i haven't ideas about your problem
    in db it's "TM " or "™" or ... ?
    Original (Coming - output):  "<PAY_TXT>PAYκ Contact your bank or financial institution to make this payment from your cheque, savings, debit or transaction account.</PAY_TXT>"
    Something like XAE or "K" after PAY Value in the xml tag and continued the text value.  (Tag value is not getting copied exactly here - i am sorry for that )
    that's ok. i need to see the problem not the data as is
    Expected (output):  "Here it needs to produce the "PAY TM" (Here "TM" should be super scripted to "PAY" Value in tag).
    as super scripted in xml?
    as idea - you can have <PAY_TXT>PAY TM</PAY_TXT> and in publisher set TM as super
    Designing XSL Subtemplates - 11g Release 1 (11.1.1)

  • Scripting with Vbscript against SAPGUI

    Hello everyone,
    Im new in this field, the thing is that i want to create scripts with vbscript in order to automate some business processes.
    I have been reading the SAP GUI Scripting API guide, and some other documents, but i dont know how to use the classes, methods, functions, etc. of the sapfewselib.
    Somebody, know how to make reference to this library in order to use it on Vbscript??
    If you can put some code examples, that will be great.
    Thanx,

    Please find sapfewse.ocx
    (C:\Program Files\SAP\FrontEnd\SAPgui\sapfewse.ocx)
    and try this code:
    Dim sap As New GuiApplication
    Set conexion = sap.OpenConnection("name_of_the_server_in_SAP Logon")
    Set sesion = conexion.Children(0)
    sesion.findById("wnd[0]").maximize
    sesion.findById("wnd[0]/usr/txtRSYST-MANDT").Text = "Client"
    sesion.findById("wnd[0]/usr/txtRSYST-BNAME").Text = "User" '
    sesion.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = "password"
    sesion.findById("wnd[0]/usr/pwdRSYST-BCODE").SetFocus
    sesion.findById("wnd[0]/usr/pwdRSYST-BCODE").caretPosition = 8
    sesion.findById("wnd[0]").sendVKey 0
    or try this:
    Set gi = CreateObject("SAPGUI.ScriptingCtrl.1")
    the better way to work with SAP GUI Scripting is with a record. Please go to RZ11 transaction and change the following parameter to TRUE:
    sapgui/user_scripting
    then Logoff an Logon again
    then Alt+F12 (Customizing for Local Layout), click in Script Recording and Playback and record some transaction
    the generated code is itself executable and you can modify o attach this code to another software that supports VBScripting like MSExcel
    If Not IsObject(application) Then
       Set SapGuiAuto  = GetObject("SAPGUI")
       Set application = SapGuiAuto.GetScriptingEngine
    End If
    If Not IsObject(connection) Then
       Set connection = application.Children(0)
    End If
    If Not IsObject(session) Then
       Set session    = connection.Children(0)
    End If
    If IsObject(WScript) Then
       WScript.ConnectObject session,     "on"
       WScript.ConnectObject application, "on"
    End If
    session.findById("wnd[0]").maximize
    session.findById("wnd[0]/tbar[0]/okcd").text = "/nMM01"
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/cmbRMMG1-MBRSH").key = "1"
    session.findById("wnd[0]/usr/cmbRMMG1-MTART").key = "ROH"
    session.findById("wnd[0]/usr/cmbRMMG1-MTART").setFocus
    session.findById("wnd[0]/tbar[1]/btn[5]").press
    session.findById("wnd[1]/usr/tblSAPLMGMMTC_VIEW").getAbsoluteRow(0).selected = true
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB1:SAPLMGD1:1002/txtMAKT-MAKTX").text = "TEST"
    session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB2:SAPLMGD1:2001/ctxtMARA-MEINS").text = "UN"
    session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB2:SAPLMGD1:2001/ctxtMARA-MEINS").setFocus
    session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB2:SAPLMGD1:2001/ctxtMARA-MEINS").caretPosition = 2
    session.findById("wnd[0]/tbar[0]/btn[11]").press
    If you have any doubts please feel free to send me an email, I have worked some years with SAP GUI Scripting.
    Regards,
    Arturo Bernal
    [email protected]

  • Changes from Visio 2010 to 2013 - highlighting entire line drawing document with text fields and changing line colors

    I work with very large visio drawings that are basically line drawings (network drawings) with text boxes indicating equipment location. We work in future and current drawings, future has colored lines indicating connection type and objects have text in
    them that indicate if they are new by having red text. Current drawings have all black lines and black text.
    Here's my dilemma, previously I would Ctrl+A and then change all text and all lines to black in Visio 2010, everything would change no problem. In Visio 2013 every text box now get's a black border around it, I've tried selecting all text boxes at once
    and trying to remove the line but no luck.
    These drawings are HUGE and it takes me a good hour just to change between future and current where previously it took me seconds. I have many coworkers and we're all experiencing he same issue with the move to 2013.
    Is there a macro or some vb script I can utilize to select all text boxes and remove the black outline?
    Hope you can help!

    try this macro
    Sub Simple()
    Dim sh As Shape, counter As Integer
    ActiveWindow.SelectAll
    For counter = 1 To ActiveWindow.Selection.Count
    Set sh = ActiveWindow.Selection(counter)
    If Len(sh.Text) > 0 Then sh.Cells("Geometry1.Noline").FormulaU = "IF(LEN(SHAPETEXT(TheText))>0,1,0)"
    Next
    MsgBox "All text borders set invisible"
    End Sub
    if in your drawings you have only lines and text label (NOT rectangles, circles and other shapesconteined text for example) this macro can help !

  • Img tag inline  with text

    I realize that discussions on how to include an image/icon inline with text has been done before. It appears that this problem has not been solved yet. Does anyone know if it can be done or we have to live with an insufficient implementation of html in Flex? The code below is what I am trying to execute; have a small icon next to some text. Thanks in advance.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
         <![CDATA[
             [Embed(source="assets/studentsImageIconSmall.jpg")] public var iconTest:Class;
         ]]>
    </mx:Script>
    <mx:TextArea width="100%" height="100%">
            <mx:htmlText>
                <![CDATA[
                    <p>You can include an image in your HTML text with the &lt;img&gt; tag.</p><br>
                    <img src="assets/studentsImageIconSmall.jpg">Text next to the image.<br>
                    <img src="assets/studentsImageIconSmall.jpg">Text next to the image.<br>
                    <img src="assets/studentsImageIconSmall.jpg">Text next to the image.<br>
                ]]>
            </mx:htmlText>
        </mx:TextArea>
    </mx:Application>

    You could use Iframe but there're a few drawbacks you can read more about this here
    http://www.deitte.com/archives/2008/07/dont_use_iframe.htm
    And also see an example of flex + iFrame here
    http://www.deitte.com/IFrameDemo3/IFrameDemo.html

  • Seeing Users You Have Shared A Script With

    Is there a way to see which users you have shared a script with?  I have gone in and added the email addresses of a few people with different roles and was wating to do a couple of things:
    Make sure everyone who needs access I have added
    Color code those who are co-authors or commentors
    I don't see anywhere that I can view those I have given access to, to verify or do either of those two things.
    Your help is appreciated.

    Hi Joe
    Once your shared script has been accepted by the users, you can see all the users with whom you have shared the script at 2 different places.
    1.Just select (don't open) the script in the Projects View. Notice at the bottom right corner it would say Shared Document (x users) where x is the number of users including you who have access to the document. Click on it to reveal the name and role of all the collaborators.
    2.If the script is opened, notice in the bottom bar. You can see Shared Document (x users) there also and you can click on it to reveal all collaborators.
    Try it and let us know if it works for you.
    As for the different colours, when different collaborators comment on a script the text box in which the comment appears is of different colour depending upon the role of the collaborator.
    Let us know if this works for you.
    Thanks
    Ali
    Adobe Story Team

  • I have created a .pdf form with text boxes, but the recipients are unable to fill in their answers.

    How can I distribute a form with text boxes so that the recipients are able to type into the boxes?

    This forum is for the Adobe FormsCentral (formscentral.adobe.com) which is a service that allows you to create, collect and analyze data using an online web form. You should ask PDF related form questions in the Acrobat forums: http://forums.adobe.com/community/acrobat/forms
    I'll move your post to that forum so you don't need to retype it. They can help you out...
    Randy

  • Displaying Variables values with Text also in the selection screen of repor

    hai
    I have one InfoObject ZPLANT .When i try to excute the report then im getting only the Values of ZPLANT(not Text of those values) .Like below
    ZPLANT :-
    101 -
    (im getting like this)
    101 London Plant ( i want like this ,when i try to excute the report).
    Please tell me how to do .
    rizwan

    Yes kamaljeet ,
    When we press F4 , then we will gwt some values .
    I want those values with description also ..
    Pls tell me how can i get those F4 values with text in the selection screen of report .
    i ll assing the points
    rizwan

  • I replaced my iPhone with a Galaxy 5 and am not receiving all of my text messages. The sales person told me to remove my phone number from iTunes to stop this from happening. Is that true? What does iTunes have to do with text messages?

    I replaced my iPhone with a Samsung Galaxy5 and I am not receiving all of my text messages now. The rep at the store told me to go to iTunes and take my phone # off of the account and that would fix the problem. Is that true? What does iTunes have to do with text messages anyway?

    You need to remove your phone number from the iMessage system.
    Read here: http://support.apple.com/kb/ts5185
    ~Lyssa

  • When converting word doc to pdf, my images with text only show the background color of the text box.

    I have a word doc that I am trying to conver to pdf.  I have jpegs with text boxes on top of them on one page.  It looks great on the screen but after I convert to pdf, the text boxes only have half the text, the first half of the text box is just white - the background color.  If I take the background color out of the text box, the text converts over fine but I need the background color.
    I have tried many things here on the print settings, standard, high quality print, unchecking the compression on the images.  Any help?

    Thank you for your posting. These forums are specific to the
    Acrobat.com website and it's set of hosted services, and do not
    cover the Acrobat family of desktop products. Please visit the
    following forums for any questions related to the Acrobat family of
    desktop products:
    http://www.adobeforums.com/cgi-bin/webx/.3bbeda8b/

  • How to Trim Rectangle with text to create reflection?

    Hello Everyone,
    I am realtively new to Illustrator and I am facing a problem that I am hoping some expert here can resolve. I have some text and I have converted it to outlines. Now I want to create shine on it. I want to fill a rectangle with white color and then clip it with text to give reflection effect but I can't figure out how to do it. I have selected my text and rectangle and tried all options in path finder tool but nothing seems to work. Please guide me how can this be done.
    Regards,
    Afraz Ali

    Afraz Ali,
    If you want to have the colour/colours/colour transition of the rectangle where the text is is nothing outside it, in other words colour the text with the colouring of the rectangle, you may:
    Use Live Type over the rectangle, select both, and Object>Clipping Mask>Make.
    With outlined type, you have to turn the lettershapes into a Compound Shape first.
    As you can see, it is simpler to just use Live Type, and it is editable.

  • Apple wireless BT keyboard with TEXT MESSAGING?

    I know that I can sync the Apple wireless bluetooth keyboard with the my iPhone 4, but I just want to verify that it will work with text messaging, in addition to the usual email, etc. apps. Frankly, that's the main reason I need it. I messed up my elbow from texting so much. I don't want to, but I MUST text a lot, so I figured I'd get the keyboard to save elbow injuries. Sounds silly -- lugging around a wireless keyboard in order to text... but it actually wouldn't be so bad. I do a lot of texting from my house, anyway.
    One more thing -- The wireless keyboard can only be paired with one device at a time, right?

    The Bluetooth keyboard will work with the messaging application.
    I know I always turn the Bluetooth off on the iPhone so when I pull out my keyboard it is a bit of a pain in the ***. Granted I only use it with long emails on the road that would take an hour to write with the keyboard on the iPhone, so it's not too bad. The iPad dock keyboard will also work with the iPhone and iOS4.x so if you need a keyboard and don't want to deal with the Bluetooth than that is an option too, just a thought.
    As far as the Bluetooth keyboard goes it can only be paired with one device at a time.

  • Solved: InDesign CC: Problems with text in text box: text flows around invisible object

    I just upgraded from CS4 to CC. I have two problems with text in some text boxes:
    The text seems to flow around invisible object that I cannot find or delete. It's as if there is a photo or other object behind the text box; but when I press COMMAND-a to select all, I don't see any such object.
    When I move this text box, the layout of the text within changes. For example, when the box is high on my spread, the text flows correctly within the box; but when I move it down, it flows around that hidden other object. For another example, when the box is low on the page, the text starts at the top of the box; but when I move the text box up, the text starts somewhere in the middle of the box.
    I have checked margins of the text box and the paragraph options of the text paragraphs (margins, indents, alignments). They all look OK.
    If I modify the text box, checking the box "Ignore text wrap", then the problem goes away; but then the text also will not flow around a real object that I want it to flow around.
    Solution:
    There were objects in a hidden layer on that one spread. It seems that in CS4 when you "select all" you would also select objects in hidden layers; but in CC it doesn't.

    Arthur, Garry
    Would be great if you could send the files as attachment in an email to [email protected]
    Else, you may post here using these steps: http://forums.adobe.com/message/3994281
    Thanks!
    - Neeraj

  • Create survey/poll with text fields

    I want to create a survey in a meeting with text field type answers.  How would I do this?  I am using the hosted version of Connect and saw some reference to a Presenter add-in for PowerPoint, but don't seem have that.  We would like to have fields such as:
    Participant information (name, contact information
    Suggested future topics
    What should I use to do this since the Poll Pod obnly allows for multiple choice or multiple answer options and not key-in fields?
    Karl

    Adobe Presenter 7 is a product sold separately from Adobe Connect. Adobe Presenter can be purchased from many resellers.  It is a plug-in for MS Powerpoint and has the ability to upload many times of quizzes and polls in lots of types of formats.  You can download a 30 day trial from here:
    http://www.adobe.com/cfusion/tdrc/index.cfm?product=presenter&loc=en_us
    Adobe Presenter is only available for the Windows platform. MS Powerpoint for Mac does not allow third-party plug-ins like Presenter.

  • Move graphics with text--but not inline--in PM...??

    Hello, is there a way in PageMaker to move graphics with text but not inline? I ask because right now I see two options for graphics:
    --inline, so you cannot place the graphic exactly where you want AND the text only flows way above or below--but not next to--the graphic
    or
    --independent so you can place the graphic exactly where you want and the text DOES flow right next to the graphic, but then the graphic doesn't move with the text
    I'd like to be able to place graphics exactly where I want AND have them move with the text, like the "Move object with text" option in Word.
    thank you!
    L

    well it has been a while since i used PageMaker so i didn't realize it was "dead."
    though i'm not surprised and am kind of glad. i was hired into a new job recently
    to work on a department newsletter, and i'm trying to find a good authoring program
    within our budget. right now the newsletter is in Word but we've had a lot of problems
    with Word so i'm seeking an alternate solution. i'd like Frame but again there isn't
    enough money in the budget. i need a good option that is $500 or less...i'm trying Publisher
    now too but not enough functionality...

Maybe you are looking for

  • Time Machine forcing computer to restart

    I have just bought a new iMac and am trying to back up onto a external hard drive using time machine. I have erased and partitioned the Hard Drive and then tried to back up onto it. When I do this it works until about 12gb of the 203gb are backed up

  • Apple TV can see my iMac Library

    I have home shareing turned on both the computer/iTunes as well as the Apple TV but I can not get it to see my library. I have checked my network, iTunes account, updated both iTunes and my Apple TV, but still is not working. Anyone have a suggestion

  • Errors being used by a bean in wls8.1

    i have many ss ejbs running in wls 6.1 under domain1. i have one ss ejb (called Submit) running in wls 6.1 under domain2 which makes calls to the beans in domain1. this is working fine. i'm migrating domain2 to use wls8.1, and am getting all kinds of

  • Mapping the "Windows" key in Gnome

    Hi, I want to use the Windows key for several keyboard shortcuts (e.g. Win+E to open Nautilus). By default it's not working. I found a solution described on the wiki: https://wiki.archlinux.org/index.php/GN - ows.22_key I applied it, and it works ...

  • Switch recommendation, to add more wired ports to network

    I have a home network that goes from a broad band modem to an Apple AirPort Extreme.  I use the wireless for our iPhones and iPads.  However, ive wired the house so that my computers, NAS, and Apple TV are all wired.  It works great -Time machine is