Name an object - Simple? JavaScript/Windows

Hey all!

And again, I have a problem in a fairly simple thing. I didn't look for a code looking for the Style of paragraph as i want to, so far no problem here. I fount the point, swapped to the selection tool so it can change the selection of the text instead of the text box and then I want to name this object. All this, but I can't do it! Hahahaha

Take a look:

// LOCALIZA O PARAGRAPH STYLE DA REFERÊNCIA
var oDoc = app.activeDocument;

//First loop through all stories then through all paragraphs in each story
for(n=0; n< oDoc.stories.length;n++){
    for(i=0;i<oDoc.stories[n].paragraphs.length;i++){

        // If paragraph style is "Silkeborg" then select paragraph and insert "S " before
        if  (oDoc.stories[n].paragraphs[i].appliedParagraphStyle.name == "referencia") {
            oDoc.stories[n].paragraphs[i].select();
            }
        }
    }

// SELECIONA O BOX
app.toolBoxTools.currentTool = UITools.SELECTION_TOOL;

// NOMEIA
app.activeDocument.selection.name= "Modelo";

He's looking for, if found, change of selection tool, but just will not mention the subject. What I am doing wrong?

Here is another script I found that the names of the object of the same object tag:

var myDocItems = app.activeDocument.allPageItems;

for(var i = 0; i < myDocItems.length; i++)
  if(!myDocItems[i].name)
    myDocItems[i].name = myDocItems[i].label;

And this one work, but this object that looking at my script is not a label, so I can't use it.

Any tips?

Thank you guys! CyA!

'Sélection' is always a table, you cannot use

.. Selection.Name =...

You must use

.. selection [0] .name =...

Second, "a label" is not a problem :-) All managers of related texts have a label (and usually it is empty). I don't know if you should use "name" or "label" in this case - I think that the advantage of the 'name' in CS5.5 he's showin in the layers panel.

Third (!), there are 1. no need to "switch to the selection tool" to set a selection and or use app.select.  JavaScript allows instant access to everything, then you can simply define the name of the outside frame of any paragraph using something like

oDoc.stories [i] .paragraphs [n] .parentTextFrames [0] .name =...

Note that a single paragraph can have more than a single "parent text block" - this paragraph maystart in one and end in another.

Tags: InDesign

Similar Questions

  • How to generate QML objects using javascript?

    Hello

    I'm trying to generate new labels whenever the information is changed. I am aware of generate and load XML. However, I am looking for a way alternative simple generate labels or other objects using javascript. How to do this?

    This page contains an example to create components dynamically:

    http://developer.BlackBerry.com/Cascades/reference/bb__cascades__qmlcomponentdefinition.html

  • QNXStageWebView and javascript window.open

    So, it seems that QNXStageWebView must have the support of javascript window well. I've implemented the following:

    webView.enableJavaScript = true;
    webView.blockPopups = false;
    webView.zOrder = 0;
    

    But the window.open event does not seem to be opening on their own. It was then that I noticed the OpenWindowEvent class and included:

    webView.addEventListener(OpenWindowEvent.OPEN_WINDOW, handleOpenWindow);
    private function handleOpenWindow(event:OpenWindowEvent):void {
        trace(event.url);
        trace(event.name);
    }
    

    think about it, it was how you were supposed to manage the new windows. Unfortunately event.name always returns correctly and event.url is STILL empty, so I can't even handle the event manually.

    Am I missing something? Anyone had any experience windows javascript with the new class of QNXStageWebView of handling? I'm pulling my hair out trying to understand how these are supposed to be treated and there is very little information about this class right now.

    I just had a quick glance at the documentation here:

    http://www.BlackBerry.com/developers/docs/airapi/1.0.0/QNX/media/QNXStageWebView.HTML#eventpenWindow

    It seems that the url is actually put in capital letters: URL, although the name is not.  Try this.

    ... Jim

  • Can I get an id/name of object state during execution?

    I would get State id and name an object when running in a tip action. Is this possible? I can probably make what I want using variables, but it would be cool to just enter the name of the State. Thanks in advance!

    You can specify the name of the element to a slide object in a tip Action, but there is no way to 'capture' the name.  It is the same for the States of the objects.  At this point advanced Actions don't have functions to do these things.

    However, if you're skilled enough with the JavaScript code you would probably be able to do.

    Except that it is 'cool', exactly WHY would you do that?  Perhaps there is another way to get similar results that CAN be done with the current functionality.  And you are publishing to SWF/HTM or HTML5?

  • problem using Javascript window.open Apex 4.2

    I'm trying to use javascript to open a new window in Apex 4.2

    When the user clicks a button on the item, I want to open the page in a new window

    That's what I coded:

    On the button

    under "the ACTION ONCE the BUTTON has been CLICKED" I select "redirect url".

    then enter this: javascript: window.open ('f? p = A:P: & SESSION.) ") ;  where A is the number of the application and P is the page of the application

    This method works.

    Click the button and a new page opens

    the problem is that the old page; the one I was on, disappears. It becomes a blank page with "[object]"displayed in the top left corner, nothing else on the page.

    Is there another way to do this?

    Try wrapping it in a vacuum similar to this:

    JavaScript:void(Window.Open...);

    or to add with

    Returns false;

    as

    JavaScript:Window.Open (...); Returns false;

  • Can a form variable contain an object complex javascript?

    I have a method in a script object fragmentScript that creates an object of javascript to format as below:

    customerObject
    name [string]
    address [string]
    City [string]
    State [string]
    List of accounts [table]

    When the script is done running, the subform that contains the script becomes hidden and must pass the object to another subform that becomes visible.

    I can pass this object via a form variable (located in the file-properties, Variables tab form)?  In other words, a form variable can contain a complex javascript object?

    Thank you

    Elaine

    Hi Elaine,.

    The tempRetCust variable seems to be assigned twice, one assigns an XFA object (with a value property) the other he attributed to a string (without a value property).  So I think that eval (tempRetCust) will work, eval (tempRetCust.value) would be the same as eval (undefined).

    Bruce

  • Do a right mouse click on the name of the file causes Windows Explorer stop.

    Do a right mouse click on the name of the file causes Windows Explorer stop.

    The problem is sometimes caused by a third-party extension. ShellExView can be useful to see what shell extensions have been introduced in the Explorer. Lire read on this topic, then scroll down to download the x 86 (32-bit) or x 64 (64 - bit) version here near http://www.nirsoft.net/utils/shexview.html

    When you run it, click the column of company for sequence entries in alphabetical order. Suppose Microsoft entries are in good faith and focus on others. Is something listed that is useless or unknown? If so, select it and click the Red (on top left) task to turn it off. You can find it easier to disable them all and then reactivate (green area) one at a time and try to explore until the culprit is found.

  • If I buy a person's computer and windows is registered in their name can I have register it in my name with the OEM for windows

    If I buy a person's computer and windows is registered in their name can I have register it in my name with the OEM for windows

    If I read your question correctly, this article should solve your problem for you:

    "How to change name and company information after you install Windows XP"
      <>http://support.Microsoft.com/kb/310441 >

    HTH,
    JW

  • Product name: Pavilion m6-1061er reinstall Windows on the laptop

    Product name: Pavilion m6-1061er reinstall Windows on the laptop

    Serial number: [personal information deleted]

    Windows7 Home was broken, but the hardware is OK. I have no disk with Windows 7 Home.

    I have the sticker on laptop with symbols

    Product key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

    [Personal information]

    My request is: how to install Windows 7?

    Hello

    There are two options available.

    1. you can order a set of replacement recovery disks using the link below - it will reinstall the operating system, all the drivers, and almost all of the original software (the exception being often tests of MS Office).  They will also recreate all of the original scores, including the recovery Partition.

    Order HP recovery disks.

    2 another option that you might consider is to create your own Windows 7 installation disc.

    Before you try the following, make sure that you can always read the character product activation key 25 on your label Windows COA (5 blocks of 5 alphanumeric games).

    An example of a COA label can be seen here.

    You can create a Windows 7 installation disc yourself using another PC - just download the good Disk Image ( this must be the same version that originally came with your laptop - it is listed as Windows 7 Home Premium 64 - bit ) from the link below and use an app like ImgBurn to burn the ISO correctly on a blank DVD - a guide on the use of ImgBurn to write an ISO on a disc is here.  These Images are clean and a very respected source (Digital River).

    Windows 7 sp1-iso-official-32-bit-and-64-bit

    Use the disk to perform the installation, enter the activation key of Windows on the label of the COA at the request and once the installation is complete, use ' 'phone Method' described in detail in the link below to activate the operating system -this made method supported by Microsoft and is popular with people who want to just have a new installation of Windows 7 without additional software load normally comes with OEM installations.

    http://www.kodyaz.com/articles/how-to-activate-Windows-7-by-phone.aspx

    You may need, additional drivers and software are here.

    Best regards

    DP - K

  • How can I remove the user name and the image of Windows XP new Start Menu

    Two questions:

    1. How can I delete the user name and the image of Windows XP new start; and

    2. my computer keeps asking me to press the F1 key to start Windows.  How to skip this part?

    Thank you.

    Hello

    The image of user account can be removed by disabling the Welcome screen. Or, by opting for the classic Windows theme. Follow the method described in this article, if you want to remove the user name and the picture in the Start Menu, without disabling the Welcome screen and Windows XP theme.

    For those who want to delete the user name and the image of user account from the Start Menu, in order to have a blue white Panel at the top, try this:

    Registry warning
    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    How to back up and restore the registry in Windows
    http://support.Microsoft.com/kb/322756/

    Step 1:

    a. start Windows Explorer and go to this folder:
     
    C:\Documents and Settings\All Users\Application Data\Microsoft account images

    b. in this folder, rename the BMP file that corresponds to your user account.
     
    (For example, if your user name is Robert, rename Robert.bmp to old_Robert.bmp)

    c. then rename the following folder:

    C:\Documents and Settings\All Users\Application Data\Microsoft account Pictures\Default pictures
     
    to something else, for example,.
     
    C:\Documents and Settings\All Users\Application Data\Microsoft account Pictures\No_Default images.

    Step 2:
     
    To remove the user name, follow these steps

    a. Click Start, click "RUN" and type "regedit.exe" and navigate to this key:
     
    HKEY_CURRENT_USER-Software-Windows Microsoft\------CurrentVersion-policies-Explorer

    b. in the right pane, the value NoUserNameInStartMenu-value data 1.

    c. close Regedit.exe and restart Windows.

    You'll find yourself with a blue area at the top of the Start Menu.

    Regarding the pressing 'F1' to start Windows, you have made no changes or was there a system crash after which the problem started?

    You may need to change the boot sequence in the BIOS to the default settings. I recommend you contact your PC vendor for this.

    Warning of the BIOS:
    BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

  • Client Windows 7 Professional DNS fails to resolve the name - when connectin to a Windows Server 2003

    A professional Windows 7 workstation is unable to resolve the name when connecting to a Windows Server 2003 server.

    I ran the Portqry tool and discovered a problem with the Port 53 and open this Port in the Windows Firewall on the client and Windows Server 2003.  However, it may not always resolve the name and I can't get the Windows 7 workstation to join the domain.

    Our DNS server is at the ISP, but enabled DNS on Windows Server 2003.  I can ping the IP address of the server from the Windows 7 client

    nslookup is solved using the FULL domain name.

    Any ideas on other settings, I need change and port that I need to open to allow?

    Thank you.

    To help with this problem, please go to the TechNet Windows Server forums .  They can help you better than we can in the Windows Vista forum. Boulder computer Maven
    Most Microsoft Valuable Professional

  • Winmail in vista mail export then problem of file name different when imported into windows live mail?

    win mail in export Vista mail then face the different file name problem when importing into windows live mail?

    I have dell laptop and vista 32 - bit os worm and now I change my laptop and have os windows 7, but when I export the name of folder windows vista mail rename (long file name) so when I import in windows 7 in the windows live mail client it is not imported as well as in win mail. folder and sub-folder is not in good
    the path folder and subfolder and subfolder; s subfolder is not to this strucherd only in win mail in vista. so, how to solvedthis problem and I want to win software mail in windows vista then where to download in windows 7. PS please help me I have the database of records of mamy creat inside.

    Hi ChintanThakkar,

    Since you are facing problems with its import to Windows Live mail, you can publish your application in the Windows Live Forum for assistance.

    Windows Live Support

    http://windowslivehelp.com/solution.aspx?SolutionID=0f26bfb0-7799-46a9-A969-dfc8186110f7

    Hope this information is useful.

  • Try to copy a folder with subfolders, some don't copy, get the message that the folder names are too long under Windows 7

    Hi, when you try to copy a folder with lots of subfolders, some files don't copy.  I get a message that the folder names are too long, and the only option is to ignore these files.  Anyone know the maximum folder (and also) name length that will copy windows 7?

    Thank you

    Steve M

    Hello
     
     
    a. What are the data you're trying to move?
    b. what operating system (for example Windows files) files?
    c. What is the method that you use to copy data?
     
     
    Windows 7 supports filename up to 260 characters. I would ask you to decrease the characters in the file name and then try to copy the files.

    Let us, run disk checking hard disk utility and then check.
    Here's how:
    1. open the computer by clicking the Start button, click computer.
    2. click on the drive you want to check, and then click Properties.
    3. click on the Tools tab and then, under check for errors, click Find now. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    To automatically repair problems with files and folders that the scan detects, select automatically fix file system errors. Otherwise, the disk check will be a problem, but not to fix them.
    To perform a thorough check, select search and attempt to recover bad sectors. This analysis tries to find and repair physical errors on the disk itself, and it may take much longer to complete.
    To check for errors file and the physical errors, select both automatically fix errors in file system and search for and attempt recovery of bad sectors.
    4. click on start.
     
     
    Depending on the size of your drive, it may take several minutes. For best results, do not use your computer for any other tasks while it checks errors.
     
    Important: Running chkdsk on the drive if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data can be lost.
     
    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Download the client computer name using java or javascript

    Hi guru,.

    ... JDev 11.1.2.4.0...

    I don't have any application in the ADF and I want to get the client computer name using java or javascript. I searched on this, but I have found that this javascript method

    function getWorkstationID() {var ax = new ActiveXObject ("WScript.Network"); alert (ax.ComputerName); }

    but that use ActiveX that only work in IE with some security configurations, and I want to get the computer name of any browser client.

    Can you please help me to get the client computer name?

    Try one of these 2 ways:

          HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
          String computerName = request.getRemoteHost();
    

    or

          HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
          InetAddress i = InetAddress.getByName(request.getRemoteAddr());
          String computerName =  i.getHostName();
    
  • DW CS5 file names are not in the window files?

    Hi everyone, it's absolutely makes me the wall now, but when I go to download files, it does not display the file on my remote server name in Dreamweaver CS5 (files window) in some cases! The only way I can locate a file is first find the date/time last modified, make a note of it and find it. It's very embarrassing. Why DW does not display the name of the file in some cases. Thanks much for any help.

    PS. This occurs when the files are in a folder, in a folder, in a folder, it is the third file in the folder of the site.

    When records are deeply nested, the column displays the file name is not wide enough. You must make the column wide by dragging the separator in the title at the top of the files Panel bar.

Maybe you are looking for

  • Error with the Addons page

    I get "error downloading" while trying to install add ons, after reinstalling, the add ons page now appears very basic with broken images but the navigation bar (Add-ons, Extensions, Plugins, etc.) appears unaffected. What should I do? (And what is t

  • I see more than 1 directory at a time

    Hi, I work on Windows XP Professional (SP3) (tydiying-Up) preparation for upgrade to Windows 7. Here is the fault: I call a directory on my desktopm and then I opened a subdirectory in itm, but when I close the subdirectory, I haven't been back to th

  • HP DVD writer SW820: driver problem with DVD SW820

    I don't know what happened to my player / driver but that is the question.  My shown drive upward in the Device Manager and the properties it showes a Code 39 "Windows cannot load load the driver for this hardware device." The driver may be corrupted

  • Internet connection sharing does not work anymore

    I have used Windows Vista Home Premium for 2 years now on my laptop. Internet connection sharing enabled to connect to the internet via my wireless adapter and allowed me to share my internet connection through the ethernet port. He worked for more t

  • How we uninstall windows debugging systems?

    OK, so I downloaded it and it won't let me do anything. I don't want to buy it. I tried to do it on my pc but I can't find it in any of my stuff.