Use bridge to create the text layer that contains special characters

Hi, guys.

I want to create a psd using bridge. but failed. Can someone help me?

Here is my script:

script2 = "var docWidth = 1650;';"

script2 += 'var docHeight = 1650;';

script2 += "var docName = 'Before';';"

script2 +=' docRef var = app.documents.add (docWidth, docHeight, 300, docName); " ;

script2 += "var myLayer1 = docRef.artLayers.add ();"; "

script2 += "myLayer1.kind = LayerKind.TEXT; « ;

script2 += "myLayer1.textItem.kind = TextType.POINTTEXT; « ;

script2 += "myLayer1.textItem.font = 'News702 BT'; « ;

script2 += 'myLayer1.textItem.size = 13;';

script2 += "var textColor1 = new SolidColor;";

script2 += "textColor1.rgb.hexValue ="F8F3E9"; « ;

script2 += "myLayer1.textItem.color = textColor1; « ;

script2 += "myLayer1.textItem.contents ="abcd\"abd\"ed\ "afa\" ";" « ;

var bt = new BridgeTalk();

BT. Target = "photoshop."

BT. Body = script2;

BT. Send();

the problem is the content of text contains "or". ""

You have some problems with your script, you give the values for the width and height for the new document, and they will default the ruler settings you have in Photoshop, this cannot be pixels.

The name of the font should be the postScript name and that they contain no spaces.

It is best to pass a string encoded in the script and then decode it in Photoshop: -.

var text = encodeURI('abcd\'abd\'ed\"afa');
var bt = new BridgeTalk();
bt.target = "photoshop";
bt.body = bt.body = "var main = " + script.toSource() + "; main(" + text.toSource() + ");";
bt.send(4);

function script(text){
var docWidth = 1650;
var docHeight = 1650;
var docName ='Front';
var docRef = app.documents.add(new UnitValue(docWidth,'px'),new UnitValue(docHeight,'px'), 300,docName);
var myLayer1 = docRef.artLayers.add();
myLayer1.kind = LayerKind.TEXT;
myLayer1.textItem.kind = TextType.POINTTEXT;
myLayer1.textItem.font='Georgia';
myLayer1.textItem.size=13;
var textColor1 = new SolidColor;
textColor1.rgb.hexValue = 'F8F3E9';
myLayer1.textItem.color = textColor1;
myLayer1.textItem.contents =decodeURI(text);
}

Tags: Photoshop

Similar Questions

  • How to create the text field that accepts (only Alphabates no numbers or numbers)

    Hey guys,.

    I just want to know how to create a text field that accepts (only text without characters or numbers)?

    I want to insert validation that field only accepts the alphabates no number or numbers are allowed!


    Thanks in advance!

    In the designer, click the field that you need to validate and open the script window, together the menu show drop-down list to validate in the drop-down list and place the code in the script window. Make sure that the language is Javascript and run is defined on the Client. If you don't see the script window goto window-> Script Editor Menu item.

  • Font size unstable when you create the text layer in batch processing

    Hello

    Using photoshop CS6 on Mac, I see a problem with one of my batch sript which is only task is to apply a water embossed mark to the images that I've resized so that the longest side is always 500px. (varies depending on how I've cropped short side).

    In most cases, the text element, I add to the image seems to be in good condition. But then no reason apparent, it will suddenly apply the text (that I put to 24pt) and it means big. To solve the problem, I have to reduce the size of police (via shares pallate) down to 8 pt. Then he begins to appear more or less correctly (for a while) up to maybe a few weeks later, when I open photoshop to run the task again and suddenly pt 8 fonts is FAR too small and I have to bump up to 24pt again.

    I don't know what I could do to cause this problem. I never waste time with processing another batch and then to resolve this issue when it occurs.

    Thank you

    If this is the cause of the problem, a step in the Action that changes the resolution of 300ppi ("with resampling"unchecked) could help.

  • How to remove or modify a captured text layer that contains a single character in Cp 5?

    My captured text layer contains a single character "7". This makes it immediately when I publish the movie, but I don't get any options when I try to change the layer by clicking right on it.

    Can anyone help because it is very annoying...

    Hello

    Welcome to the forum.

    Since you mention "capture", I assume that you point to an object of typing? You cannot change this immediately. Depending on what you want to achieve, could provide two workaround solutions:

    1. If you only want to display something hits (demo - but another text that your character), replace the strike by a text Animation object (context menu), you will be able to change.
    2. If you want the user to type text, remove the object of typing and replace it with a text entry area.

    Lilybiri

  • AppleScript cannot change the font of the text layer

    I used Applescript to create a text layer and specify its properties, but when I specify the font I get a compilation error:

    Impossible to define 'class NTR' to 'TradeGothic-Bold ". Unauthorized access.

    That sounds like a kind of permission error.

    Here is a little simplified script:

    Tell application "Adobe Photoshop CS4"

    say current document

    do new layer of art Properties {name: "File name", type:text layer}

    say the text object layer of art 1

    the value {content, size, stroke color, position, type} {"thefilename", 12, {class:RGB hexadecimal color, hexadecimal value: 'CC0000'}, {2, 12}, text of paragraph}

    set the font to "TradeGothic-"BOLD""

    tell the end

    tell the end

    tell the end

    If I put the police manually and use 'get properties of the text object in layer art 1', the Script Editor returns (with a long list of other properties):

    "" police: 'TradeGothic-"BOLD".

    so I think that I've specified the name of the font correctly at least. In the list of properties returned by the Script Editor, the font is blue like above, but all other property names are purple. It's I have to say something.

    Well, after some trial and error, I answered my own question. Here's what worked:

    Tell application "Adobe Photoshop CS4"

    tell the active document

    new layer art with properties {name: "File Name", layer type: text}

    the text of the layer 1 of the art of storytelling

    the value {content, size, stroke color, position, type} {"thefilename", 12, {class hex color: RGB, hex value: 'CC0000'}, {2, 12}, paragraph text}

    tell the end

    set the font for the text of art layer 1 to "TradeGothic-"Bold"object

    tell the end

    tell the end

    Maybe someone who understands OOP and/or better than I do, may explain why it worked and my first try didn't.

  • XML - text form loading external text contains special characters

    Hi @ all...

    in my projects, I often use xml files to load external text that I can format it in css and it worked fine until now...

    I have a site that I am prograaming in Italian and German and in both languages, there are amount of text that contains special characters like ' to' 'o'' 'e' 'u' 'a' 'u' and so on... the problem is that when I write a text with characters in xml file when the text is loaded into this flash of special characters are not recognized , and instead of them appears a small square...

    I tried to load the text from a html instead of an XML file (because in HTML, I know how to write these special characters and let them display right in my pages html... for example = & agrave; but not way... the flash now loades the text & agrave; instead of to...)

    How can I solve this problem?

    a big thanks to everyone!

    Hello

    You should probably incorporate the fonts that you use in your FLA file before you publish the SWF file. Just go through the steps in the video @ http://blip.tv/file/2357619 if that helps.

    Thank you!

  • Manages the entries of the user... of special characters and things

    I was wondering but in my case that I have to accept the entry of user in preparation for sending emails. APEX text box controls manage the entry so that any special characters or oracle commands are ignored so that they become plain text? If not, is there an easy way to handle this? In my case, I'm alittle concerned by the fact that I send the e-mail using PL/SQL, so he needs to not only check HTML but PL/SQL special characters special characters and escape characters in need.

    David,

    You're safe with just using a variable binding.

    See you soon,.

    Janet Tyson

  • Start the text layer (using the text tool) of the current-time indicator - Adobe after effects CC

    It's something that would drastically improve the speed of my workflow. When I click inside a composition using the text tool, the text layer is always positioned at the beginning of the composition.

    Is it possible to make the text layer from the current-time indicator, so don't constantly do defiler to the beginning of the composition and drag the text layer forward in the desired position?

    Thank you very much.

    There is a preference: create layers at Composition Start Time.

  • I just started to use the Muse for our design agency and learn to build us a new site, I managed to create a basic Viewer that contains sliding images based on what I have to do now is have a window POP that goes into the details of the pr

    I just started to use the Muse for our design agency and learning how to build us a new site, I managed to create a basic Viewer that contains sliding images, what I have to do now is have a PDP window that goes into details on projects, what I want is a piece of text or icon that when you ride on it , and then click a separate window opens with additional information in, once finished reading the news, you can click to close the box, any advice on how to do this?

    The best way to do what you ask is with the widget of Composition. Start with the ToolTip predefined, which by default displays the info on working capital. You can change the display option to click, which is what you are looking for. You can also add the close button or the info disappear in slowing.

    David

  • I use an iMac with El Capitan and Photoshop CS6. I'm trying to add a shadow to a text on a picture. I followed the instructions to double the text layer but not dropshadow dialog box appears and I can't. Where would it be?

    Double click on the text on the right side of the display panel does not cause a dialog box open. I just need to know where the dialog box is so I can add the drop shadow

    Please make sure that you double-click on the text layer in the layer panel not the name of the layer. With the text, it can be difficult if the name is too long. You can also right-click on the text layer in the Panel and bring up the contextual menu and select 'blending Options '.

  • Make the text layer transparent logo

    Hello

    I want to create a logo with the text layer and the background transparent (so that both are found with the gray and white square)

    I have it done before, but when I now create the circle logo, create the text, then use magic want to select the text you want to delete and make them transparent, he said: I can't edit without pixelation of the image.

    Once I did I use the magic wand to try to make it transparent, it removes the text and watch only the circle.

    Can someone give me a step by step guide?

    The attached picture is the effect I want to create with transparent lettering.

    Thank you in advance!

    Rphotoshop_problem.png

    You get the error because you are trying to remove pixels from your text layer.

    When you have the choice of characters, activate the layer with the circle, then click on remove. (Hide your text layer when finished)

    BTW better (than the magic wand) to select the text is in control, click on the thumbnail for the text layer.

  • Center of a sentence within the text layer

    Hi all

    I would like to focus a sentence within a text layer for example I have two phrases within a text layer and one of them, I want to be centered in the layer itself

    Is it possible to do?

    I don't know that I follow. If you want two centered sentences then create a text box by clicking and dragging in the pane of the model with the text tool, start to type, define the Center paragraph style and then make sure that the point anchor and position of the text layer are centred.

    Another way is to use the shortcut Alt/Option + Ctrl / Cmnd + shift + T to add a new text layer or just use the menu layer and add a new layer of text and the cursor will be centered in the Panel of the model which have not messed you with the base line. With the "centered" applied paragraph style you will be have a centered text.

    With the latest version of AE, you can add an expression to the position that calculates the area of a text field and then aligns the text field in the Panel of the model. If you really fancy, you can watch the size of a text field and offset as well vertically. I don't have the time to write this expression for you, but it is possible.

  • How to create a text box that is visible on all chassis?

    Hi all

    I hope I'm in the right forum for this question, seemed to be the most likely place...

    I have created this Flash program and I am trying to insert a 'text area' dynamics that may be visible on all chassis.

    How could achieve in CS6? I know how to create a TextArea component, but it isn't visible on the image I create in, I think?

    I use only Flash CS6 Pro for about a month now, a few times a week, so I'm still pretty new to develop in Flash.

    I use:

    Adobe Flash Professional CS6

    * Do not know if it is important in this situation, but the Actionscript code in my program is Actionscript 3...

    Any ideas/suggestions would be greatly appreciated... !

    Thanks in advance,

    Matt

    I would recommend you create the new layer and plant the TextArea inside manually for now.

    If you right-click the label of the layer that is currently selected in the timeline of your image, then right-click, there should be an option to create a new layer.  Simply click this option and if the layer is not where you want it compared to other layers you can move it by dragging it.

    When you add dynamically from the content you can not add it to any specific layer unless you add it to a movieclip/sprite manually planted you put into this layer.  As I said, a dynamic content is not related to an image unless you place it in an object that is.

    Experience everything.  You don't break anything by trying.

  • Cannot create the text

    This is my first shot using Photoshop and after downloading PS6 on my computer at home and the laptop yesterday evening thanks to a subscription of Adobes, I immediately ran a question about the two systems running windows 7.  Question: I am unable to create any kind of visible text or get the lines or the slider that show as I type.  I messed up with the police (which makes greater/smaller) and my text color is different from my background and still no luck.  Once I type something however and start a new layer then I see my text appear in the window of the layers on the previous layer.  Any suggestions on how to solve this problem would be appreciated.  I apologize if this question has already been requested and we responded and I missed it.  Thanks in advance.

    Try the following steps:

    Open 'Preferences of Performance' as shown above. Under Windows, this parameter will be available under the tab 'change '.

    See the 2 boxes highlighted on the screenshot above. Check if the option "use graphics processor" is selected. If this is the case, click on '1' advanced settings.

    Choose "Basic", as shown in the screenshot.

    Click OK and try to create the text.

    If it still does not work, go back to the 2nd screenshot, disable the 'Use graphics processor' option by unchecking the checkbox (2), as shown in the screenshot and see if that fixes it.

  • Is it possible to create the text block with non-uniform formatting is applied to the text?

    Hi all

    By this script

    var doc = app.documents.add(70, 20, 300, "Test", NewDocumentMode.RGB);
    var textLayer = doc.artLayers.add();
    textLayer.name = "Text";
    textLayer.kind = LayerKind.TEXT;
    
    var solidColorRef = new SolidColor();
    solidColorRef.rgb.red = 0;
    solidColorRef.rgb.green = 174;
    solidColorRef.rgb.blue = 239;
    
    var ti = textLayer.textItem;
    with (ti) {
         contents = "Blah-blah-blah!";
         kind = TextType.PARAGRAPHTEXT;
         height = new UnitValue("20 mm");
         width = new UnitValue("70 mm");
         position = [ new UnitValue("0 mm"), new UnitValue("0 mm") ];
         font = "MinionPro-Bold";
         size = new UnitValue("24 pt");
         color = solidColorRef;
         justification = Justification.CENTER;
    }
    

    So I can create a block of text with uniform like formatting

    SNAG-0011.png
    But, as far as I understand it, it is impossible to make an image and apply different sizes, colors, etc. (Please confirm or refute it).

    To achieve the result by script as follows:

    SNAG-0014.png

    The r to Browse datashows the formatting only to the beginning of this text.


    What I want to achieve is to take a block of text in the InDesign document and re-create it in psd-file. (The text must be editable)

    Y at - it another way to achieve this: by plug-ins, extensions, incantation, etc.?

    Kind regards
    Kasyan

    So that other things I noticed, it's text.jsx does not work with UnitValues. It uses the action Manager to work with textRanges. And it seems that Adobe changed the textItem units operating. Therefore, it is difficult to understand what values to use. Text.addNewTextLayer () and Text.modifyTextLayer () seem to what different values for the text of the same size.

    So below is an example updated the PS-Scripts-post on how to create a text layer with different textRanges using the current text.jsx.Note I've hard-coded sizes for that to work as I had hoped.

    function tsrDemo(doc) {
         var doc = app.documents.add(new UnitValue(70,'mm'), new UnitValue(20,'mm'), 300, "Test", NewDocumentMode.RGB);
         // we want to create a new text layer so create a new TextOptions with the contents as the argument
          var opts = new TextOptions("Blah-blah-blah!");
           // override the default settings
           opts.layerName = "Test";
           opts.kind = TextType.PARAGRAPHTEXT;
           opts.height = 800;// pixels
           opts.width = 200;
           opts.position = [ 0, 0 ];// pixels
           opts.justification = Justification.CENTER;
           opts.font = Text.findFont("Minion Pro Bold");
           opts.size = 6;// not sure what unit this needs
           opts.color = Text.toRGBColor(0, 174, 239);
    
           // create a new text layer with those options
         var layer = Text.addNewTextLayer(doc, opts);
    
           var opts = new TextOptions( layer.textItem);
           opts.contents = layer.textItem.contents;
           // now need to construct TextStyles for each range we want to set
           // for ranges we can only change the font, size, and color
           // first set a textStyle that matches the TextOptions
          var s1 = new TextStyle(undefined,undefined,undefined);
           // now set a textStyle for each different style you want
          var s2 = new TextStyle(undefined, 12, Text.toRGBColor(0, 0,0));// for some reason size values here are not the same scale as above
           // define more TextStyles as needed. here we only need one
    
          // Now create the set of ranges to apply the styles over
          var ranges = new TextStyleRanges();
           // the first range must start at 0.  In this example we want the first range unchanged
           // so we use the TextStyle that matches the TextOptions
           // this range covers the entire contents
          ranges.add(new TextStyleRange(0, opts.contents.length, s1));
           // this range covers the middle 'blah'
           ranges.add(new TextStyleRange(5, 9, s2));
            // we now add the ranges we set to the TextOptions
          opts.ranges = ranges;
    
           Text.modifyTextLayer(doc, opts, doc.activeLayer); 
    
        };
    
        tsrDemo();
    

Maybe you are looking for

  • Satellite A660 BIOS update error

    Tried to run the update advised by Toshiba but encounter the following error: «There is an error occurred, please check below the elements.» 2.20 highest BIOS versionBattery capacity over 20%A/c is attached BIOS confirmed: TOSHIBA 1.80 14/09/10 on th

  • update to Microsoft Windows Mobile 6.1 on the pocket pc

    I have a HP Ipaq HX2490b with Microsoft Windows Mobile 5.0 build (2003?) 14366.1.0.1. why the new 6.1 is not compatible with versions earlier than 14847 version? It's been almost what I obsolete, and it is only a few years old. Is there a way to get

  • record the location of the screenshots

    Hi all a straight line. Lollipop on the compact z3 appears to save screenshots in the internal memory, while they went to the external card of kitkat. Can a control where the screenshots get saved to with our lolloipop versions? Thank you Gary

  • How to dimensionnera the JPG in Illustrator image?

    I have skills that are very basic in Illustrator, but known 'reasonably' in Photoshop. I am now trying to create a version vector logo in Illustrator, but the logo contains an image raster JPG for example.My question is how this part of the logo dime

  • Referring to APEX_APPLICATION values. G_F (n) table without a process OnSubmit.

    I have box implemented as a column of report on an APEX report page. I try to access control values in a PLSQL process using APEX_APPLICATION. G_F01. It works very well in an OnSubmit Page process, but does not return a value if used in dynamic actio