Script for document name labels

How hard would this be?
A script that would type the file name into the document. I searched for similar threads but no luck. Here are the details...
1. If the document was named TEST.pdf the script would type TEST in the document.
2. The font color, size, and type would be Black, Arial Bold,  0.4 in.
3. The font would be converted to outlines.
4. A rectangle 0.05" larger than text would be placed around the text.
5. The rectangle would have no fill and a 100% magenta spot color named "CC" stroke.
6. The rectangle stroke would be moved to the CC layer (pre-existing layer).
7. The text "TEST" would be moved to the Artwork layer  (pre-existing layer).
Thanks for any input or help.
Anton

Anton, this should be pretty close for a guide… I don't know what your exact font name would be… so this uses my closest match. Also you don't mention text positioning on the artboard/doc… The stroke is default 1pt as is. The height of the outlined text would be dependent on your font and you may have to tinker with the size where shown…
#target illustrator
function docNameToText() {
     if (app.documents.length = 0) {
          return;
     } else {
          var docRef = app.activeDocument;
          var docName = docRef.name;
          var text = docName.replace(/\.(ai|eps|pdf)$/i,'');
          var arialFont = app.textFonts.getByName('ArialMT-Bold'); // Add font name here…
          var nameText = docRef.textFrames.add();
          nameText.contents = text;
          var nameChar = nameText.lines[0].characters;
          for (var i = 0; i < nameChar.length; i++) {
               nameChar[i].characterAttributes.textFont = arialFont;
               nameChar[i].characterAttributes.size = 40; // Adjust font size here…
          var textGroup = nameText.createOutline();
          textGroup.position = [36,-36]; // Half Inch down/across from top/left
          var groupBounds = textGroup.visibleBounds;
          var ccLayer = docRef.layers.getByName('CC');
          textGroup.move(ccLayer, ElementPlacement.INSIDE);
          var artLayer = docRef.layers.getByName('Artwork');
          // This can't be the right way to do this now can it?
          var boxTop = groupBounds[1] + 4;
          var boxLeft = groupBounds[0] - 4;
          var boxWidth = (groupBounds[2] - groupBounds[0]) + 8;
          var boxHeight = (-groupBounds[3] - -groupBounds[1]) + 8;
          var spotBox = docRef.pathItems.rectangle(boxTop,boxLeft,boxWidth,boxHeight);
          spotBox.filled = false;
          spotBox.stroked = true;
          //spotBox.strokeWidth = 1; // Default is 1pt
          var ccSpot = docRef.swatches.getByName('CC');
          spotBox.strokeColor = ccSpot.color;
          textGroup.move(artLayer, ElementPlacement.INSIDE);
docNameToText();

Similar Messages

  • Mobile 3.1 can't find bundle for base name labels

    Hi all.
    I installed the Business Objects Mobile 3.1 few days ago on a dedicated server without using proxy server because the installation is in test mode with no external access. Both products (BO Enterprise XI3.1 & BO Mobile 3.1) are installed on separate Windows Server 2003 machines. The installation has the default database (Apache Derby) and both services (VAS & VMS) are working. The mobile device is a virtual device on my PC using Windows Mobile 6.1 operating system.
    The client application has been installed on mobile device and users can succesfully log on to the CMS using Enterpise Authentication method. After this two folder icons are displayed on screen, first for Local Documents and second for Server Documents. Clicking the Server Documents the following error message is displayed on screen "Can't find bundle for base name labels, locale el_GR (0x15)"
    I tried to resolve the problem changing the regional settings from Greek to US in servers, my PC and Virtual Device but the exact error still appears. Does anybody knows what to do or where to look for a solution?
    Thanks for reading my message. Happy and creative new year for all.

    Here is my suggestion.
    Do you have the property file named "webui-resources_en_US.properties"?
    Here is the example
    language="en"
    country="US"
    locale = new Locale(language, country);
    bundle = ResourceBundle.getBundle("com.<companyname>.webui-resources");
    copy the webui-resources_en_US.properties file to the directory
    com.<companyname> in your workspace/IDE/localdirectory. or ftp that file to classes/com/companyname directory
    This should work. I am using it that way.
    which appserver r u using?

  • I am new to scripting & I need Script for Document color mode

    Hi,
    Please help me to create a script which should find the Document color mode. I am new to scripting. And please let me know how to use the same.
    Balaji

    Are you using the Extendscript Toolkit Editor (ESTK)? In the Help menu you can find all the properties for Document that can be queried/changed.
    (Personally, I don't use ESTK, because I really really hate it. But I don't want to miss the Help, so I made my own version. I have Illustrator CS4, and it's possible your version doesn't have this, but under Document I find:
    documentColorSpace
    DocumentColorSpace:
    DocumentColorSpace.RGB
    DocumentColorSpace.CMYK
    readonly
    The color space used for the document.
    For the how-to-use I glady refer you to Adobe's own Starting With Scripting guides.)

  • Script for Document Footnote options change before first footnote above space.

    Hi hope u r all fine,
    Please help for this. I want to change the space in Document footnote option.
    That is Minimum space before first footnote = "12 pt"; and Rule above of First Footnote in Column should be Rule off.
    I need script for this.

    @hasvi – look up the properties and methods here:
    Jongware
    InDesign JavaScript Reference Guide
    http://www.jongware.com/idjshelp.html
    I recommend the chm files listed there for easy searchability.
    There is also a HTML version and a online version in HTML.
    Properties like footnoteFirstBaselineOffset, footnoteMinimumFirstBaselineOffset, ruleOn and ruleOffset with their possible values are documented here:
    http://jongware.mit.edu/idcs6js/pc_FootnoteOption.html
    To set the properties and their values you have to address the document.footnoteOptions:
    var myDoc = app.documents[0];
    myDoc.footnoteOptions.properties = {
        footnoteFirstBaselineOffset : FootnoteFirstBaseline.X_HEIGHT,
        footnoteMinimumFirstBaselineOffset : "12 pt",
        ruleOn : false
    Uwe

  • Table for Documents Name List

    Hello Everyone!
    I have a simple question:
    Does exists any table in B1 who gives  the document name according to its Object Type?
    Thx in advance,
    Juan Jimenez

    Hi,
    You can check this document regarding the issue reported by you:
    [Transaction Type Abbreviations|http://help.sap.com/saphelp_sbo88/helpdata/en/45/114a3129fc4805e10000000a1553f6/frameset.htm]
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Script for Document Setup size...

    Hello All,
         I have a request for a script, not sure how one would go about it but here we go.
    An AI CS4 user selects a shape, they then execute a script that...
    Resizes the Document Setup Art Board to one inch larger (length width) than the selected shape.
    Then a rectangle is drawn in the document and is sized the same as the art board.
    Any help would be great!!!
    Thanks in advanced.
    Anton

    All,
         I am tweaking this script again and have run into a road block that you may have a simple answer for.  When I execute this script when selecting a single object it works perfect, if I execute it while selecting a group of objects the script will not apply the spot color to the selection.  The script will however do everything but apply the spot color.  Here is the latest edit. Thanks for any input.
    Anton
    #target illustrator
    function main() {
         if (app.documents.length == 0) {
              alert('Open a document before running this script');
              return; // Stop script here no doc open…
         } else {
              var docRef = app.activeDocument;
              with (docRef) {
                   if (selection.length == 0) {
                        alert('No items are selected…');
                        return; // Stop script here with no selection…
                   if (selection.length > 1) {
                        alert('Too many items are selected…');
                        return; // Stop script here with selection Array…
                   } else {
                        var ccSpotColor = cmykColor(0, 100, 0, 0);
                        var ccCol = spots.add()
                        ccCol.name = 'CC';
                        ccCol.color = ccSpotColor;
                        ccCol.tint = 100;
                        ccCol.colorType = ColorModel.SPOT;
                        var cc = new SpotColor();
                        cc.spot = ccCol;
                        var selVB = selection[0].visibleBounds;
                        var rectTop = selVB[1] + 36;
                        var rectLeft = selVB[0] - 36;
                        var rectWidth = (selVB[2] - selVB[0]) + 72;
                        var rectHeight = (selVB[1] - selVB[3]) + 72;
                        selection[0].parent.name = 'ARTWORK';
                        selection[0].filled = false;
                        selection[0].stroked = true;
                        selection[0].strokeColor = cc;
                        selection[0].strokeWidth = 1;
                        var regLayer = layers.add(); // Creates Regmark Layer
                        regLayer.name = 'Regmark';
                        var tcLayer = layers.add(); // Creates TC Layer
                        tcLayer.name = 'Through Cut';
                        var ccLayer = layers.add(); // Creates CC Layer
                        ccLayer.name = 'CC';
                             var Cutline = selection[0]
                             Cutline.move(ccLayer, ElementPlacement.INSIDE);
                             var ThroughCutBox = tcLayer.pathItems.rectangle(rectTop, rectLeft, rectWidth, rectHeight, false); //This is TC box
                        ThroughCutBox.stroked = false;
                        ThroughCutBox.filled = true;
                        var tcSpotColor = cmykColor(0, 100, 90, 0);
                        var tcCol = spots.add()
                        tcCol.name = 'TC';
                        tcCol.color = tcSpotColor;
                        tcCol.tint = 100;
                        tcCol.colorType = ColorModel.SPOT;
                        var tc = new SpotColor();
                        tc.spot = tcCol;
                        ThroughCutBox.fillColor = tc;
                             tcLayer.visible = false;// Make TC Layer Invisable     Here
                        artboards[0].artboardRect = (ThroughCutBox.visibleBounds);
                        redraw();
                        rectWidth = (rectWidth-72)/72;
                        rectWidth = roundToDP(rectWidth,1);
                        rectHeight = (rectHeight-72)/72;
                        rectHeight = roundToDP(rectHeight,1);
                        var textString = rectWidth + ' x ' + rectHeight;
                        prompt('Copy Me', textString);
    main();
    function roundToDP(nbr, dP) {
         dpNbr = Math.round(nbr*Math.pow(10,dP))/Math.pow(10,dP);
         return dpNbr;
    function cmykColor(c, m, y, k) {
         var newCMYK = new CMYKColor();
         newCMYK.cyan = c;
         newCMYK.magenta = m;
         newCMYK.yellow = y;
         newCMYK.black = k;
         return newCMYK;

  • Crop & Straighten script for vinyl record labels

    Hey guys i have thousands of circular vinyl record labels that i have taken photos for.
    I have created an action for doing this but it keeps opening many chunks as separate files and never closes/saves them leading the program to run out of memory.
    I am hoping that a script can be created to allow the processing of a folder where it automatically saves/closes the files to a new destination.
    It would also be better if it can close without saving and chunks that are small which would save me having to delete them manually.
    Thanks

    Have a look at this thread, it may help.
    http://forums.adobe.com/message/3430751

  • PowerShell script for AD name change

    I need to change all users logon name in AD to their first name.last name    Server 2003

    Here is my suggestion of a PowerShell V1 script to rename all users (sAMAccountName):
    # Filter on all users that have givenName and sn assigned.
    $searcher=[adsisearcher]'(&(objectCategory=person)(objectClass=user)(givenName=*)(sn=*))'
    [void]$searcher.PropertiesToLoad.Add('distinguishedName')
    [void]$searcher.PropertiesToLoad.Add('sAMAccountName')
    [void]$searcher.PropertiesToLoad.Add('givenName')
    [void]$searcher.PropertiesToLoad.Add('sn')
    $searcher.PageSize
    = 200
    $Results =
    $searcher.FindAll()
    ForEach ($Result
    In $Results)
        # Retrieve values.
        $DN
    = $Result.Properties.Item("distinguishedName")
        $NTName
    = $Result.Properties.Item("sAMAccountName")
        $First
    = $Result.Properties.Item("givenName")
        $Last
    = $Result.Properties.Item("sn")
        # Construct desired "pre-Windows 2000 logon" name.
        $NewName
    = "$First.Last"
        # Make sure new name 20 characters or less.
        If ($NewName.Length
    -gt 20)
            # I don't know how to trim $First in PowerShell to make $NewName 20 characters.
        # Check if name should be updated (case insensitive).
        If ($NTName
    -ine $NewName)
            # Trap possible error.
            Trap
                "Unable to rename user $DN to $NewName"
                "Error description: $_"
                Continue
            # Bind to user object in AD.
            $User
    = [ADSI]"LDAP://$DN"
            # Assign new name.
            $User.sAMAccountName
    = $NewName
            # Save the change to AD.
            $User.SetInfo()
    Test first, by commenting out the SetInfo() statement and echo $DN and $NewName for all  users. Note that the script could trim $First to limit $First.$Last to 20 characters, but I could not find a way to do this. Also, this script does nothing to prevent
    duplicate sAMAccountName values, but the possible error will echo to the screen.
    Richard Mueller - MVP Directory Services

  • Script for Preprinted continues label print

    Hi All,
    I am developing one script in that the stationary was preprinted one with label dimensions of
    10 CM width 7 CM height.
    For this dimensions I had created new page format and assign to device type EPESCP.
    Problem:
    I am printing my label on dot matrix printer. It is giving me a weird problem. Print preview looks perfect. In script page I have given enough space to print the preprinted text after that window to write the label content. First page is getting printed perfectly and on second page it printing the label 3 lines upwards and on third page it printing 6 lines upwards and so on... so this is disturbing  my alignment.
    While assign the page format in device type there is a tab Formats in that
    Printer initialization, Reset after exit, End of page, End of line what is the use of the this options ?
    By
    Ram.

    Hi Tripathy ,
         Thanks for Quick and valuable reply.
    In my case ,i am print label of constant 15 lines per page. So in second page also its going to print 15 lines.
    The first page is print correctly but in next page on wards 23 lines moving upwards.
    The problem is till there.Pls give me ur suggestion its urgent.
    By,
    Ram.

  • Window Arrange New Window for (Document name) is not creating a floating document? It works on my PC, but not my Mac (Mavericks).

    So I know this command is supposed to create that document in a new window and have it float ontop of the original document. It (the new window for the document) is supposed to stay in front of anything on the application frame, like the UI does. But on my mac it keeps going into the background when I click onto a different document. I don't know why it does that. This command works fine on my PC.

    So I know this command is supposed to create that document in a new window and have it float ontop of the original document. It (the new window for the document) is supposed to stay in front of anything on the application frame, like the UI does. But on my mac it keeps going into the background when I click onto a different document. I don't know why it does that. This command works fine on my PC.

  • Insert OLE w formula for document name

    Post Author: joemoceri
    CA Forum: General
    Hi, I'm still stuck using CR 8.5 and need to add a Word Doc to a report.  I can do it as an "insert OLE object". However, I won't be using the same doc file all the time.  The doc file name will be changing each time the report is run, so i need to add it as a formula.
    I can't remember how to do it.  I did it once in CR 7 and I don't have access to it.
    How do i add a Word Doc into a report using a formula to specify the file name?

    Post Author: joemoceri
    CA Forum: General
    OK.  I figured out how i did it in the past...
    Microsoft Access - I added an ODBC link to the report to an external Access table with OLE objects in it.
    Then on the main report i added the ACCES table via ODBC to get the ole object to appear on the report. 
    This allows a report to have a dynamic, OLE object to appear based on data in the report.

  • For four days I have been unable to open a lot of documents. When I try I get a message "The document "name" could not be opened. You don't have permission. This has happened to an important letter which I corrected four times. My Mac has altered the name

    This problem began when I typed in an address http www etc., making one mistake in the address. I corrected it and then tried to copy the address because it was long (I wanted to be able to acces it another time), and that's when the trouble starrted. I just copt documents to get a new one because it's quicker, but it is unorthodox, I know. Since then whenever I copy a document i cannot open it, and it often puts a gobledegook ending to the document name. I've started emailing texts to myself so as to keep them, but I MUST be able to use documents normally. I hava a MacBook Pro, using OS Mountain Lion 10.8.5. I don't like it. It's fairly new, and has messed up my system of documents : the size is alll wrong and the tabulations are worse than ever. I use text edit because I wanted to use Macdictate because I am handicapped (arthritis and firbomyalgia) but I have never been able to get it to work. Since I changed OS I cannot use Text edit properly any more. Please help me. I think it must be a bug that came through when I was putting this address in four days ago. I went to the site once I'd corrected the address and it was perfectly normal. I shall ring them today and ask them if this has happened to anyone else. I live in France. Thank you for your advice. Because I am handicapped and I do not dirve, it is very difficult to get to a Mac store. I deleted Mac cloud documents because I don't want to use it and I thought it might solve the problem, but it didn"t.

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    I've tested these instructions only with the Safari web browser. If you use another browser, they may not work as described.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click anywhere in the following line on this page to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1 or if it doesn't solve the problem.
    Boot into Recovery. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • How to add a comment for each caption label present in a document?

    Hello everyone,
    I am trying to write a script to add comments for each caption label for figure and table.
    How can I select a caption and use Comments object for adding a comment?
    I tried using AutoCaptions list for going through all captions present in a document but Comments.Add function is not available with Caption object type.
    When I try adding a comment by selection manually I am able to add. Here is my piece of code.
    For Each objCaption In ActiveDocument.AutoCaptions
    objCaption.Comments.Add Range:=Para.Range, text:="[" & sIdLabel & sCurrentNumber & "]" & vbCrLf ' ID‘}
    ' increment number for next TAG
    sCurrentNumber = Format(Val(sCurrentNumber) + Val(sStepNumber), String(Len(sCurrentNumber), "0"))

    Hello Stefan,
    Thanks for your response.
    I'm trying to add comments for each table and figure present in my document.
    I have earlier tried a script to add comments for each outline level and it works.
    When I tried adding a feature to add comments for each caption in the document, it didn't work.
    Apparently when I try to go through the document by each para, captions are selected as para. So my current script is not able to parse though all the captions.
    Then I went with the other option where I'm trying to use AutoCaption object list to go through each caption. In this Caption object do not have Comment.Add function.

  • Script to change layer name in to Document name.

    Hi I would like to make the active layer name the same as the document name.  I know very little about scripting.  I found this script:
    var idoc = app.activeDocument;
    var ilayer = idoc.activeLayer;
    var filename = idoc.name;
    ilayer.name = filename;
    It does almost what I need it to do. except that it also copies the ".ai" in to the layer name.  Is there some way to modify this script to have it exclude or delete the file extension?
    Thanks for any help.

    Or, if you want to keep the same construction as your example...
    var idoc = app.activeDocument;
    var ilayer = idoc.activeLayer;
    var filename = idoc.name;
    filename = filename.slice (0, filename.lastIndexOf(".")); //just add this line to the construction.
    ilayer.name = filename;
    Gustavo.

  • Script and program name for MM:OUTWARD CHELLAN

    Hi all ,
    can any one give me the script name and program name  for MM:OUTWARD CHELLAN.
    Regards,
    Arun.j

    Hi
    There are Std Scripts for PO,RFQ,CONTRACT, GRN , GI Note etc in MM
    What is this Outward challan? what is its' equivalent SAP business document?
    Check in The Tcode NACE for the relavent one, for the Output applications like MR,MD,EF,ME etc
    Reward points for useful Answers
    Regards
    Anji

Maybe you are looking for

  • File Sharing Issue 10.7.5 to 10.9.1

    I have a '06 Mac Pro running 10.7.5; and I have 2 laptops running 10.9.1. For some reason my file sharing does not work from my Mac Pro; before the upgrade even with Mountain Lion I I was able to connect to my Mac Pro. Now since upgrading to Maverick

  • Importing; tracks are in different playlists

    I have imported a CD where the track names were not available from the store. I have typed in all the information, - titles in Greek - but I find the tracks in separate/different playlists. Each playlist contains the tracks of each separate Greek alp

  • Question of  i++ and interface

    i want ask what is the difference bewteen I++ and ++i ? what is the difference bewteen interface and extend a class?

  • BAPI BAPI_ADDRESSORG_SAVEREPLICA

    Hi Friends, can we use  FM BAPI BAPI_ADDRESSORG_SAVEREPLICA for Adderss details  and also Mobile Tel no, FAX_NUMBER, Email Address . contact persons in vendor masetr update. pls help anyone to solve this issue. Regards, Sreenu.

  • RtePlugin - Paragraph Format Selector

    Hi, Is anyone else experiencing the following issue: When enabling the paraformat plugin for the RTE, when you highlight a word that is within a paragraph and select a format for it, i.e. H6, it applies it to the entire paragraph and not just the sel