Changing the text in a scriptUI window

I'm sure it's trivial, but i cannot get it.
I've got his window displaying my document's name and a button that triggers an action (init)
When going to another illustrator document, since my init action checks the document's name, i'd love the script window to display the right name to avoid confusion.
I know how to build a dialogue, but i don't know how to update part of it (let's say a statictext)
see the code here, doing nothing but alert(doctitle) on click :
/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global $, Folder*/
Script Test
Par Franck Payen mars 2014
http://fr32c.free.fr
var doc; // document actif
var docTitle; // titre du document actif
function displayUI() {
    var dialogue = new Window ("palette", "Afficher les calques ", undefined, {closeButton:true, resizeable: true});
    dialogue.orientation = "column";
    dialogue.alignChildren = "fill";
    dialogue.margins = 10;
    dialogue.location = [0,40];
    dialogue.preferredsize = [200, 400];
    // onResize needed on Mac OS X
    dialogue.onResizing = dialogue.onResize = function () {this.layout.resize ();}
    var groupe0 = dialogue.add ("group", undefined);
    groupe0.orientation = "column";
    groupe0.alignChildren = "fill";
    var monDocTitle = groupe0.add ("statictext", undefined, docTitle);  
    var groupe2 = dialogue.add ("group", undefined);
    groupe2.orientation = "column";
    groupe2.alignChildren = "fill";
    var boutonInit = groupe2.add ("button", undefined, "Reinitialiser");  
    boutonInit.onClick = function (){       
        var messageBT = new BridgeTalk();
        messageBT.target = "illustrator";
        var messageBTcorps = "initScript()";
        messageBT.body = messageBTcorps;
        messageBT.send();
     dialogue.onClose = function (){
        dialogue.hide();
    //alert (dialogue); //will work and return [object Window]
    dialogue.show();
function initScript(){
    if (app.documents.length == 0){
        alert("Merci d'ouvrir un document avant de lancer ce script.\nL'opération a été interrompue.", "Pas de document ouvert");
        return;
    doc = app.activeDocument;
    docTitle = app.activeDocument.name.split(".")[0];
    alert(docTitle);
    //alert (dialogue); //won't work and refuse to launch the script
//    displayUI(); // v1, lance le display après l'initialisation. Scindé pour utiliser le bouton réinitialiser.
#target Illustrator
#targetengine main
var versionAi = new Number (app.version.slice (0,2));
if (versionAi > 12){
    initScript();
    displayUI();
else
if (versionAi < 13){
   alert("Ce script n'es pas compatible avec Illustrator CS2 ou des versions plus anciennes.\nL'opération a été interrompue.", "Version incompatible");

Franck Payen wrote:
I'm sure it's trivial, but i cannot get it.
no, it is not trivial, I found it was very difficult at first...
you need two things, have Illustrator return a value to bridgeTalk,
function initScript(){
    if (app.documents.length == 0){
        alert("Merci d'ouvrir un document avant de lancer ce script.\nL'opération a été interrompue.", "Pas de document ouvert");
        return;
    doc = app.activeDocument;
    docTitle = app.activeDocument.name.split(".")[0];
    return docTitle;
then have bridgeTalk read the returned value, then you can use it in your Palette
    boutonInit.onClick = function (){      
        var messageBT = new BridgeTalk();
        messageBT.target = "illustrator";
        var messageBTcorps = "initScript()";
        messageBT.body = messageBTcorps;
                    messageBT.onResult = function(returned) {
                              var docname = returned.body;
                              monDocTitle.text = docname;
                              dialogue.layout.layout(true);
        messageBT.send();

Similar Messages

  • How to change default texts in OSX dialogue windows?

    I'd like to change some of the texts that appear in the OSX dialogue boxes.
    One example: I have set my Mac up to ask for the password after N minutes of sleep. I would like to change the text in the box/window that appears when the Mac is woken up and where you are told to submit your ID and password (I'm sorry that I am not sure what exactly it says in English because I'm using another language).
    The closest thing to what I need I have come across is this:
    sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText 'Hands off'
    However, this applies only to the first login window you see after you have started the computer. I'd like to change other default texts as well.
    The default texts in different languages must be stored somewhere. How do I find them and how do I chage them? Any advice would be appreciated.

    It seems like the same problem as would be faced by someone localizing the OS, so perhaps there would be something useful here:
    http://developer.apple.com/internationalization/

  • How to change the text in a browser title bar?

    I'm new at flash and I'm finding most things obvious, but
    this is one I just can't figure out!
    How the dickens do you change the text that shows in, say, an
    Internet Explorer window?
    Is it by filename? Mine, the index page, currently shows as
    the exciting and unprofessional "index"
    I've taken over the work from someone else who I'm not able
    to contact (I know, that NEVER happens /sarcasm) so I'd appreciate
    any help I can get.
    Thanks.
    Nick

    andsoitgoes,
    > When publishing the flash file, there is an option to
    export
    > the HTML document along with the flash file.
    Yes.
    > I see no way to edit the HTML itself. How can I edit the
    > HTML template that's published?
    Depending on where you specify that file's location (which
    you can also
    set for the SWF itself), you navigate to that folder, then
    edit the
    resultant HTML file in whatever text editor you please, from
    Notepad/TextMate to Dreamweaver.
    If you're asking how to edit the template Flash uses to
    generate this
    file, you can find that (at least, on Windows) at this
    location:
    C:\Program Files\Adobe\Adobe Flash CS4\en\First Run\HTML\
    Be warned, however, that these template files, though
    HTML-based, are
    heavily programmed with JavaScript and a number of custom
    tokens that get
    populated by Flash when it goes through the publish process.
    For example,
    in the Default.htmll file inside this folder, you'll see a
    <title> tag whose
    content reads "$TI" (without quotes). Think of that as a
    varible. That
    gets populated with the the name you've given the FLA file,
    simply because
    $TI arbitrarily refers to the file name in this scenario. You
    can change
    this if you like, but if you do, make sure to safe it as a
    new file (or at
    least back up the original templates that ship with Flash).
    > Does that make a bit more sense? :)
    Only if I've properly understood your question! If I still
    haven't,
    please try again. :)
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • How to dynamically change the text of a TextObject with embedded DataField?

    Hi
    I'm trying to dynamically change the text of a TextObject at runtime, by using the .NET library. My problem is that if one or more DatabaseFieldDefinition is embedded inside my text, I'm unable to change the "static text" only, by keeping the field, e.g. I have :
    Text1 => "Contact Name: {Contact.Name}"
    and I'd like to change it to anything else like:
    Text1 => "Nom du Contact: {Contact.Name}"
    Half of my TextObject is static text while second part comes from the dataset.
    (of course the translation is dynamic - it is called at run-time and the new value to be set depends on the calling application language)
    If I simply modify the Text property of my TextObject, the {Contact.Name} embedded field is not evaluated anymore by the Crystal Engine, but considered as a single text.
    Using formulas or parameters looks quite difficult, because it means having many ones just for translation needs - I cannot control the way my users will create their reports and "force them" to use complex methods just in order to put a text and a value together...
    Anyone knows how to deal with that ?

    Only way I can think of doing this:
    1) Create a formula (call it lang) and enter the string "Contact Name" in it
    2) Place the  {Contact.Name} field next to the string
    3) So now you have:
    ContactName:  {Contact.Name}
    4) Check what localization you are after. If you need "Nom du Contact", change the lang formula so it shows "Nom du Contact" using the code below:
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Public Class Form1
    Inherits System.Windows.Forms.Form
    Dim Report As New CrystalReport1()
    Dim FormulaFields As FormulaFieldDefinitions
    Dim FormulaField As FormulaFieldDefinition
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FormulaFields = Report.DataDefinition.FormulaFields
    FormulaField = FormulaFields.Item(0)
    FormulaField.Text = "[formula text]"
    CrystalReportViewer1.ReportSource = Report
    End Sub
    I realize this may not give you consistent spacing as the translations may have strings of differnt length. Perhaps someone has other idea(s)...

  • Do you know how to change the Text Object for Billing Document?

    Hi,
    If you execute Transaction VOTX or VOTXn it will take you to Text Determination. The Billing Doc & Sales Document both has the VBBK as Text Object for me and is it like that for all.
    I need to change the Text Object to VBRK for Billing Doc, which is the ideal because I am using the Function Module READ_TEXT to retrieve text. This work perfectly for Sales Document which has VBBK as Text Object, but does not work for Billing Doc where it through as error message saying “Text 0020000021 ID 0002 language EN not found”.
    Thank You
    Kishan

    Hi kishan,
    For updating these text you can use FM 'SAVE_TEXT'.
    As for your problem, to get the parameter you need, go to the billing document, go to the text, and display it in plain page mode.
    Then you do 'GO TO' -> 'HEADER', and a pop-up window open with the parameters you need Obect type, ID, Name, ...
    Regards,
    Erwan.

  • How to change the font in query builder window in Reports 6i?

    Hi
    I am facing the old problem again and again, which is I can not find any way to change the font in query builder window in Reports 6i. The current font is so bad for alignment and ordering each part of SELECT statement. Is there any way to change this to COURIER NEW for example?

    No, but I suggest using a different editor which does allow a different text option and just pasting it in.

  • Duplicating movieclips w/textfields on them & changing the text

    Okay, there is a movie clip in the library. Has three layers.  Each of the layers is also in the library.  Layer 1 has a button symbol, layer 2 a text symbol with instance name 'item_label', layer 3 is color. instance name is 'flbutton'.  To me, it looks like this was created into a symbol itself and given intance name of 'menu_item'.
    An array is created with button label names.  A loop is created based on the number of labels in the array.  An instance of 'menu_item' is created each loop and placed on the stage/screen and the text on the button is changed to the item in the array.
    My question....how do you do that in AS3?
    var menu_label:Array = new Array("Introduction", "Templates", "Services", "Clients",
             "Testimonials", "Support", "About Us", "Contact");
    // *** menu label array length must be equal to number of
    // *** total frames inside "menu button bg" Movie Clip in the library.
    var total:Number = menu_label.length;
    var tween_duration:Number = .85;// in seconds
    var radius:Number = 185;
    var angle:Number;
    var i:Number = 0;
    function create_menu():Void
    angle = (i - 2) * Math.PI * 2 / total;
    position_x = Math.cos(angle) * radius;
    position_y = Math.sin(angle) * radius;
    var fm = menu_item_group.menu_item.duplicateMovieClip("menu_item" + i, i);//** menu_item_group is instance name already on the
                                                                                                                      //** stage and is instance of symbol in library that has
                                                                                                                      //**instance name of menu_item
    fm.stop();
    fm.bg.gotoAndStop(i + 1);
    fm.over = true;
    fm.item_label = menu_label[i];   //** here is where the text of each newly created MovieClip's text is changed
    fm.item_no = i;
    more code.........
    loop
    Can someone tell me how to do this in AS3?  I have learned how to duplicate a movieclip with DisplayObjects, but I have no way of knowing how to get to the text field in order to change it.
    Regards,
    Kevin
    ps. new to Flash. Decent amount of VB programming experience.

    You are correct about the instance names etc... my apologies... I did not save my work and lost what I was doing.  My Dev enviroment is a personal laptop with Flash.  The company has yet to purchase Flash.  My laptop did an auto Windows update.  I lost my testing .fla.
    You were right about the instance name.  It was missing from my previous example.  That has been correct.  I now get no errors, but setting the autoSize property did not work.
    I'm creating two MovieClips.  One is the MovieClip of the actual TextField and the other is of a MovieClip with the TextField on it.
    import flash.display.MovieClip;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    When I create the MovieClip of the TextField directly:
    var mcTxt:MovieClip=new clsText();   //pardon me, but I just had to use some VB naming conventions to help myself out.
    addChild(mcTxt);
    mcTxt.item_Label.autoSize=TextFieldAutoSize.LEFT;
    mcTxt.item_Label.text="Hello Willeeerrrrr";
    When I add the field without changing the text, the text field defaults to "Hello World".  When I attempt a change as in the code above, the text field looks as follows:  Hello Willeee.  If I add a fourth 'e', .text="Hello Willeeeerrrr", it will add it to the text field the next time I test.  The final 'rrrrr's' get truncated.  Wierd.
    Now, when I do the above on the MovieClip with the child text field, the text just disappears.
    var mc:MovieClip=new clsMenuItem();//MovieClip with the embedded/child textfield
    addChild(mc);
    mc.mcMenuItem.item_Label.autoSize=TextFieldAutoSize.LEFT;
    mc.mcMenuItem.item_Label.text="Hello Willred";
    The above code causes the text to display blank.
    I'm close and hope it's just a property setting...ideas?

  • How cna I change the text and background colours in iTunes?

    Can anyone tell me how I can change the text and background colours in iTunes? I am a visually impared user and my main requirement on a PC is to change the colour schemem to white text on a black background. Most software adopts the settings of your colour scheme but iTunes goes it's own and has everything on white backgrounds. I cannot read from white backgrounds (dazzle - that sort of thing). I have never used iTunes for this reason. I have always been a devotee of by far the best media player out there Musicmatch Jukebox, who allow you to edit skins in every detail. However, recently Musicmatch was taken over and users were forced to migrate to the ridiculously poor Yahoo Music Jukebox. A massive downgrade in so many ways.
    I want to use iTunes but will not be able to if I cannot sort this issue out. I downloaded 7.5 before discovering that if you want to use Multi Plugin for skins you need to go back to iTunes 7.02. I've done that, but the skins available are completely pointless to my eyes. They don't change the colours of the main components, just the graphical bit at the top.
    What I need to do is change the background of the main browser windows so that they are black and the text is white (you know the track lists and tree views, etc). This must be a very simple case of just changing the codes somewhere, but I can't find where. I read somewhere that you need to hack into something call ResourceDB inside a file called iTunes.jar. There is no such file on my PC. Could that be a Mac thing?
    Please help someone if you can. I would like to become an iTunes user. There seems to be more music available than on Napster which I currently use.
    Thanks in advance
    Z

    In my opinion, it seems that Apple has decided to sacrifice usability so that iTunes would look more like a Mac application. You are probably already aware that using Windows' built-in high-contrast settings do not work in iTunes.
    I did some hacking at the resource file a while back, but I was unable to figure out how to change the color of the background. IIRC there was a resource whose description indicated it would change the background color, but when I changed the resource, nothing happened.
    I was, however, able to figure out how to make the "large" font much larger (any size you want, I suppose). Will that help? See
    http://home.comcast.net/~teridon73/ituneshacks/index.html
    You should provide feedback to Apple:
    http://www.apple.com/feedback/
    I don't think it is too harsh to call it "shameful" that Apple has chosen this design path. Where I work, we are required to make ALL applications (or any computer interface, such as a website) section 508 compliant. Of course, I'm being a bit of a hypocrite, because I've made no effort to make my website compliant. If you have trouble reading it, please let me know.

  • How do I change the text in my titles?

    I'm new to FCP X and was wondering if anyone could help direct me....
    I am able to change only some of the text in the titles I use but others ...I can't seem to change the text (there's no text box available) ....it's really very fustrating... is there another way around this?
    If anyone is available to help me with this problemo it would be very much appreciated, thanks

    Hi Tom, have the same problem but nothing works so far. I have lion mountain and FCPX.
    I can not find any text box when using the title templates. Can not change them.
    I tried double click in the viewer box. No success.
    I tried in the info window, in the tab tex. No success because no text box available
    I tried transformation, that I can move the text box which appear in the viewer but can not change the text
    The only thing which working is: When I press Control T the basic Text will be included in the clip and there I can change the text. Why this? I do not know.
    Can you help me?
    Greetings
    N.

  • How can I change the text from impossible to read blue to black

    Unlike Chrome, which has an ad-on that changes the text to black, I have so far been unable to find a way to change Firefox's terrible light blue text to black, despite having made many attempts through Tools, Option, Colors, etc. Help will be appreciated. I am using version 30 on an HP Laptop running Win7

    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Use a compressed image type like PNG or JPG to save the screenshot.
    Make sure that you haven't enabled a High Contrast theme in the Windows/Mac Accessibility settings.
    Make sure that you allow pages to choose their own colors and check the default colors.
    *Tools > Options > Content Fonts & Colors > Colors [X] "Allow pages to choose their own colors, instead of my selections above"
    Note that these settings affect background images.
    See also:
    *http://kb.mozillazine.org/Website_colors_are_wrong

  • How to change the text in the legend of a graph programmat​ically in labview

    I have many graphs in one plot and want to show the legend the name of the graph (i.e. the filename). How do I change the text in the legend programmatically?

    Create a property node for your graph. Use the property node "Active Plot" to define which plot (or line) you want to rename. Then write the new legend label to the property node "Plot.Name". See attached.
    Tim
    Attachments:
    legend.vi ‏12 KB

  • How do I change the text on a label for a SAP delivered WD view

    Hi,
    I need to change the text that is being displayed for a label in a SAP delivered WD ABAP View. When I look at the properties for this label, the Text property is currently empty, so I assume that the text that is being displayed in the view is coming from the dictionary. I was hoping to change the text of the label via the Enhancement Framework. I created an OTR entry, then went into SE80 for the WD Component, I navigated to the view in question, I pressed the Enhance button and entered $OTR:<package>/<alias name> in the text property for the label. Finally I saved and activated and was prompted to create an Enhancement Implementation, which I did and I selected it. Everything seems to be fine (no errors or warnings). I then ran the WD application. My change was not there. I then went back into SE80 for the WD Component that I created the enhancement. I navigated to the View and looked in the text property of the label and saw that my change was not there. I repeated this process several times and each time when I added the OTR entry to the text property of the label, it saves and activates without issue (in enhancement mode), but when I run the WD App the change does not show up and when I go back to the WD View, my change to the text property is gone. I know that if I really wanted to I could register the object and add the OTR entry to the text attribute of the label, but I am trying to perform this change using a modification free enhancement. Can this be done via an Enhancement, or do I have to register the object and make my change using a modification?

    Hi Gregg,
    excellent question. I had the same problem as well before.
    What I have learned is that you cannot change a UI Element via Enhancements.
    You can add new UI Elements (e.g. new label) or remove existing elements, but you cannot change them (except the layout properties (e.g. colspan) maybe).
    The only possibilities I see is
    1. Remove the existing label, and add a new label with your desired text
    2. Do it as a modification
    3. Do it as a configuration (This means you go to the webdynpro application in SE80, right click and select "Create/Change Configuration)
    4. Do it as customizing (This means you add the URL parameter sap-config-mode=X to the URL, navigate to the label, right click on it, and select "Change Settings for Current Configuration").
    The disadvatages of 3) and 4) are
    - texts in configurations and customizing are not translatable (as far as I know)
    - if you have multiple configurations, you have to change the label multiple times
    Hope this helps a bit,
    Daniel

  • How do I change the text color of footers on select pages? (InDesign CS6)

    Good afternoon,
    Months ago, I worked with a graphic designer to put together a 100-page workbook for my training company. He turned all of the files over to me and I'd like to make a small change before we print another run for a new client. Specifically, I'm having trouble changing the text color on select pages. Since a picture says 1,000 words, let me give you an example:
    As you can see, the copyright information on the right side of the page is difficult to read here when placed over the photo (you may have to look closely, but it's along the guy's sleeve). What I'd love to do is change that part of the footer (not the left, page number side) to white text. This would make it quite a bit easier to read. There's a number of other pages in the book that I want to make this change to. I'm not sure why I never noticed it or mentioned it to the designer. I suppose I've become more discerning since then.
    Let me tell you what I've tried to do:
    I learned how to override master pages by CTRL+SHIFT clicking on the footer. However, this has not worked for me. It allows me to change the page number part, but not the copyright side. Additionally, sometimes when I override the master the formatting of the footer goes goofy. For instance, the left side and right side come together and end up in the middle of the page I'm working on.
    I'm looking for a quick way to go through and make the footers easier to read on pages where they are backed by a photo. Hoping you can help me. Please let me know if you need any other information.
    Best,
    Taylor

    I think you should have left it as it was. It seems like what you had was single pages flowing as spreads within InDesign. Like below. That is the correct way, and when you changed it to all single, it did create your footer problems.
    Will you be sending the file as a PDF to your online printer? If so, then leaving the InDesign file set as below is fine. The PDF output will separate the pages.
    All you have to do is make sure that Pages, not Spreads, is chosen when you output the PDF

  • Is there a way of just changing the text to the main menu..but not the submenus?

    Is there a way of just changing the text to the main
    menu..but not the submenus?
    Also i have looked at in the browser and when i glide over
    the menu catergories or click on them they dont show the
    submenu...what can i do to solve this?

    Does the example described at
    http://labs.adobe.com/technologies/spry/articles/menu_bar/index.html
    work for you?
    What are you doing that's different from the example?
    When you say you just want to change the text of the main
    menu without changing the submenus, do you mean you want to do so
    dynamically, at some later stage after the page has loaded?
    If so, you could try retrieving the main menu elements you
    want to update from the DOM and updating them from your script's
    event handler for whatever event it is that you want to update them
    in response to. This presumes the widget will detect this and
    update appropriately, which I can't say for sure since I haven't
    actually tried it.
    Hope that helps!
    Rob

  • How to change the text in Logon Page in NWDS7.3/EP7.3

    Hello Experts,
    I am using NWDS7.3, & there is a requirement to change the text "User authentication failed " to some custom text. The message generally comes when you use wrong used id and password while logging portal url.
    I have downloaded the WAR file and extracted the Jar file(tcsecumelogonui_core.jar) to change the text under logonLabels.properties file but i can't see the key with respect to the message "User authentication failed". I cannot find the message in the .properties file.
    Can any one please help me to fix the issue.Any help will be rewared with points.
    -Regards
    Alok

    Dear Detlev,
    Thanks a lot for your valuable answer.  I have found the text for the "User Authentication Failed" , done the changes and depoyed the Jar file . This is working.
    But the same when i try to do for  "Authentication failed. Password locked" this message comes when i do multiple failed login. I need to change the text , i found  the text in the u2022sap.comtcjesecurityimpl.jar file, i made the changes in the JAR file ,replaced with the server jar file and restared.
    But the changes did'nt get reflected. Can you please suggest if i am chaning in the correct JAR file?. I am working in NWDS7.3
    Can you please help me on this. Appreciate your help .
    -Regards,
    Alok

Maybe you are looking for

  • Mail v5.3 opens then shuts down and I cannot access mail at all

    On my MBPro running 10.7.5- mail attempts to open, then spins the disc for a minute then shuts down and gives me this message. Please can anyone help? Many thanks Here is the problem and config message Process:         Mail [248] Path:            /Ap

  • Where to see the IR/ID import progress?

    Hi! Sometimes the ID/IR import can last for a long time. Can we monitor the real time progress somewhere? Where is the log/trace for ID/IR import? (ID=Integration Directory;  IR=Integration Repository) Points are guaranteed, thanks!

  • Function Module to read stack values.

    Hello, Is there is any function module to read the stack values. My requirement is I have 3 FM modules say FM_A, FM_B & FM_C. FM_A will call FM_C. FM_B will call FM_C. In FM_C, I need to identify whether the call has been made from FM_A or FM_B witho

  • Can't Redeem iTunes Credits

    I have an iTunes video download credit. Downloading movies does not subtract from the credit. I can find no solution to using the credit, or even a reference to video credits.

  • I Pod Nano wont work

    Recently i havent be using my ipod and i downloaded the new itunes and i pluged my ipod in and the logo came on. But overnight my computer froze and it didn't charge. I have been tryong everything to get it to do anytihng. I have tryed hooking it up