Placeholder text replacement script help

Hello expert AppleScript!

I have a problem with the script to replace text placeholder from this source: https://iworkautomation.com/pages/script-tags-placeholder-text.html

For testing purposes I just wrote a text on a white sheet (not insert a text box and the text typed there) and insert an image, a placeholder text marked (and a picture too) through the instrument standard Pages: Format-> advanced-> mark as placeholder text (image) (don't remember the exact wording)

Then I executed the script but it worked only in part to replace the placeholder image but not the text.

Is there an error in this script, or maybe I did something wrong?

Thanks for the help in advance!

5.6.2 pages

OS X El Capitan v. 10.11.5

Hello

It's a bug when a placeholder is in the body of the text with one of the following conditions:

No insertion point in the document.

The insertion point is not in the body of the text (in an text box as example)

Workaround:

The script must create a new section in the document, place the insertion point in the body of the text

------

Tell application "Pages".

activate

the value of thisDocument to make the new document with properties {model: "Journal Newsletter" template}

According to thisDocument

make new section - who put the insertion in the body of the text

-MAKE ALL TAGS

-do something with a space reserved

tell the end

--------

Tags: iWork

Similar Questions

  • Object placeholder, text, symbol helps Indesign cs6

    Hi, I need a holder object in place (with text) in indesign for work wireframing, I want to add placeholder text etc. on all pages of a menu nav (or anything else that I think will be updated later) and then when I get the actual data I can change the names of nav to their real titles and it will change in all instances of the placeholder (through object of 60 pages or more)

    In flash or illo, etc., you could do a symbol etc. and change it and it would change all instances. Is there anything close to that in Indesign (the library panel does not allow for editing of the item master is he?)

    You will get instantly big mojo luck if you answer this quickly and without * very * sarcasm...

    Well, InDesign has yet to symbols.

    But you can create the object with the text in Illustrator and save it in format I. Then place the file HAVE anywhere where you need the object placeholder. When you need to make changes, change the Illustrator object and text and it will be replaced in InDesign overall.

  • Can't add placeholder text data merge for all blocks of text on the document

    I'm trying to put together a script that loops if all pages in an indesign file, search all text frames label caption1, caption2, caption3... (whenever you get to a new page, the number of text images label starts again from 1) and add a placeholder in the text data fusion: caption1, caption2, caption3... but this time, when you get to a new page the number continues to go... caption4, caption5 and so on.

    Page 1 - image text = caption1 = tag > data merge placeholder = < < caption1 > >

    Page 1 - image text = caption2 = tag > data merge placeholder = < < caption2 > >

    Page 1 - image text = caption3 = tag > data merge placeholder = < < caption3 > >

    page 2 - text = caption1 = image tag > data merge placeholder = < < caption4 > >

    page 2 - image text = caption2 = tag > data merge placeholder = < < caption5 > >

    Currently, the script is adding placeholder text merge data only for the two text frames first (out of 6) on a page (about 8 pages) and just the first image of text on the page two (out of 3)

    Any help will be greatly appreciated

    Here's the script:

    myDocument var = app.activeDocument;

    -SOURCE DATA CALLS FUSION

    main();

    main() {} function

    myDataSource var = File.openDialog ("Please select a datamerge source", "text files: * .txt");

    If (myDataSource! = null) {}

    myDocument.dataMergeProperties.selectDataSource (myDataSource);

    myDocument.dataMergeProperties.dataMergePreferences.recordsPerPage = RecordsPerPage.MULTIPLE_RECORD;

    }

    }

    -MERGE OF DATA FIELD

    function get_field (captionString, myDocument) {}

    fields var = myDocument.dataMergeProperties.dataMergeFields;

    for (var f = 0, l = fields.length; e < l; f ++) {}

    If (fields [f] .fieldName == captionString) {}

    Returns the fields [f];

    }

    }

    Alert ("error: did not find all the fields with the name" + field_name);

    }

    THE TEXT - ADD PLACEHOLDER DATA MERGE

    var countFrames = 1;

    for (i = 0; i < myDocument.pages.length; i ++) {/ / TOTAL NUMBER OF PAGES in the DOCUMENT}

    var capPerPage = 1;

    for (x = 0; x < myDocument.pages [i].textFrames.length; x ++) {//COUNT TEXT TOTAL IMAGES PER PAGE

    If (myDocument.pages [i] .textFrames [x] .label < 0) {}

    Alert ('can not find any image caption');

    } ElseIf (.textFrames [x] myDocument.pages [i] .label == 'caption' + capPerPage) {//IF IT IS A TEXT LABEL of IMAGE 'caption1' EXECUTE

    var captionString = "caption" + countFrames;

    var myTextFrame = myDocument.pages [i] .textFrames [x];

    var myDataMergeProperties = myDocument.dataMergeProperties;

    var myTextFrame.parentStory = monarticle;

    var myStoryOffset = myTextFrame.parentStory.insertionPoints [-1];

    var myNamePlaceHolder = myDocument.dataMergeTextPlaceholders.add (monarticle, myStoryOffset, get_field (captionString, myDocument)); ADD DATA FUSION TEXT HOLDER TO THE TEXT BLOCK

    countFrames ++; INCREASE THE NUMBER TO ADD DATA FUSION TEXT PLACEHOLDER FOR THE NEXT BLOCK OF TEXT

    capPerPage ++;

    }

    }

    }

    Hello

    To verify this change (replace for...) loop)

    var countFrames= 0, currLabel, capPerPage;
    
    for (i=0; i
    

    Notice countFrames starts at 0.

    Jarek

  • Fill with placeholder text does not

    My order of "Fill with placeholder text" no longer works.  No text only inserted when I select the command. (He used to work. I used it a lot.) I have read on the substitution.txt file and made my own and place in the InDesign Application folder, following the instructions that I found on one of the forums.  I can see the file, and it is named correctly. But I still get all inserted text.  It seems that something is broken. It's like InDesign does not see the substitution.txt file, even if it's in the right place. (I use CS5.1). Does anyone have a suggestion as to what might happen? Thanks in advance for any help!

    I have to fill with placeholder text works again. In my opinion, it may have been something fishy with the sequence of several frames on the line that has been not to let the text get inserted. I'm embarrassed to say that I did not sufficiently stable before that I blamed the control. I did learn some things, however, and appreciate the advice I got.

    Bonnie

  • How to disable the placeholder text in the URL from the navigation bar and search fields?

    Everytime I open a new tab (often, the homepage is set to blank) I watch 'Go to site' in the navigation bar. The search field shows the name of the active search engine until the text is registration. All I want is to be able to do is disable the placeholder text, showing the two fields as white.

    Add code to the file userChrome.css below default @namespace.

    Customization files (interface) userChrome.css and userContent.css (Web sites) are located in the chrome folder in the user profile folder.

    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    
    *|*.textbox-input:-moz-placeholder { color:transparent !important; }
    *|*.textbox-input:-moz-placeholder:hover { color:graytext !important; }

    Use in Firefox 19 +:

    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    
    *|*.textbox-input::-moz-placeholder { color:transparent !important; }
    *|*.textbox-input:hover::-moz-placeholder { color:black !important; }
  • Why did not restore my text replacements?

    Why my text replacements didn't restore my new iPad from my old?

    Hi gebloom,

    I understand that you are missing text messages on your new iPad.  I'm not sure what you mean by "text replacements."  The resources below explains how to transfer content from the iPad to the other.  This is the process you used?

    Transfer the contents of an iPhone, iPad or iPod touch on a new device

    Take care

  • Master Slide - placeholder text in a Table

    I cannot place a placeholder text in a table on my model of slides is editable. Does anyone know if this feature is available in Keynote?

    • The placeholder text do not work in tables, enter the data directly in each cell of the table.
    • Tables should be placed on a slide, not a slide master.
    • If you need a table with the same formatting on each slide, set up the table on a slide then add a table style:

    Click on the table to select: Inspector > Format > Table , and then click the button "+"

  • Japanese text replaced by boxes after the recent update of Windows

    Windows 7 can not represent the Japanese text after that Windows Update - changes the text boxes - applies to all applications - itunes, Windows Live Mail - mail header text replaced by boxes. The emails themselves are not affected - Japanese content can be displayed. Made a restoration and Japanese text returned. However then windows update again and the Japanese text has been lost, which means that this issue is one of the updates.

    Hi HiniKuru,

    Allows us to try to understand the problem causing the update.

    Install the updates, if the problem persists

    You can try to change the display language for the Japanese, follow these steps:

    1. click Startand type change display language in the box start the search .

    2. click on view change of language.

    3. in the drop-down list that appears, select the language (Japanese) that you want, and then click OK.

    Now, check if the problem is resolved, if the problem persists

    Follow the steps mentioned in the link below

    Windows 7 language packs are available for computers that are running Windows 7 ultimate or Windows 7 Enterprise

    http://support.Microsoft.com/kb/972813

    Uninstall the most recently installed update until find you the problem causing the update:

    1. click on start to reduce this includes this image, type Appwiz.cpl in the Start Search box, and then click Appwiz.cpl in the list of programs . Collapse this includes this image if you are prompted for an administrator password or a confirmation, type the password or click continue.

    2. click on view installed updates.

    3. click on recent update (go by the date) that you want to uninstall, and then click Uninstall.
    Follow the instructions that appear on the screen to complete the uninstall process.

    Note: It is not recommended to uninstall an update; We try the following steps to understand the problem causing the update. Uninstall an update at the same time, restart the computer each time and check if the problem persists.

    Let us know the problem causing the update (make a note the number of KB) and let us know for further investigation

    For more information, see the link below

    http://blogs.msdn.com/E7/archive/2009/07/07/engineering-Windows-7-for-a-global-market.aspx

    Thank you, and in what concerns:

    Ajay K

    Microsoft Answers Support Engineer

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • The placeholder text out in Arabic

    When I apply the placeholder text, it comes out in Arabic. How can I do for text space reserved fate in Latin letters?

    Press Ctrl before you click the placeholder text, and you will be

    able to choose regardless of the language of your choice.

    But I think essentially to the placeholder text follows the currently

    language, and if you set the English text of the USA or something, I have

    think you should get the appropriate placeholder text.

  • InDesign fill with placeholder text

    Can anyone imagine a good reason why Adobe refused to give

    a correct generation of features for the fill with placeholder text

    order in the menu Type?

    For good you will easily fill a frame with text of Lorem ipsum generated.

    How cumbersome is to fill text blocks 300 over 300 pages with it?

    Or is it not?

    Text frames can be useful, and they can also get on your way. If you do not need the ability to change things on all pages of the document by editing the main storyline, you might be better to not use main text blocks.

    That said, if you do want to use master text frames you shouldn't be releasing the main frame to the document (by Command-Shift clicking) page on the first page and then adding the placeholder text him. This is what it looks like you do, and that's why you don't get what you want. What you need to do is to make the first placeholder text and then place. Who will release the master images on existing pages or create new pages if you start with a one page document.

    To generate the placeholder text, start with a new document. What I'm doing, it of make a block of text that fills the full editing table, click inside the text cursor and change the font to something very small (like text 1pt with automatic line spacing). Then change the text block to get the number of columns (maybe 10, maybe 25, it's up to you). Now fill the frame with the placeholder text. The additional columns will allow more text, because to this font size, some paragraphs will not fill the framework if it is a single column. If you want a very large amount of text, select all, copy and paste them twice or more. Once your text has been generated, all select, copy, move to the actual document and paste it into a block of small text on the pasteboard. Now apply the paragraph style, you want to have text (which I suppose is in a readable size).

    If you click the out port of this text block and shift-right click in the master on the first page of the document (that you didn't him don't have not already unlocked), it will be auto-flux in all the master text frames on existing pages or create new pages as it goes if he needs. I think that's what you wanted to do from the start. Write might be a lot of work, but it really only takes a minute.

  • Change the color of the text just highlighting the placeholder text

    Hello

    Is this possible with Indesign CS6 to simply change the color of the text when I just click on the placeholder instead of having to highlight the text in the placeholder every hour.

    This is done in Illustrator, but when I do the same in Indesign, it's the bottom of the placeholder that changes color and not the text.

    I want to be able to click on several areas of placeholder text and just change the color of the text when required?

    Thank you

    Select the text block with the selection tool, and then press the letter (J) on the keyboard. and the Swatches palette or color, select your color.

  • Need help with this find/replace Script.

    Hi I got this script from Loic.Aigon.  And I got it works for find/replace simple changes however I Cannon operate for several changes.

     function cb5CallBack(target) {
            var findProps, changeProps;
            
                findProps = {findWhat:"Distributed by ",}   
                  changeProps = { changeTo:"Distributed by. ",}
                findProps = {findWhat:"Distribué par ",}   
                  changeProps = { changeTo:"Distribué par. ",}
                findProps = {findWhat:"Distribuido por ",}    
                  changeProps = { changeTo:"Distribuido por. ",},
              
            RTXT(target, findProps, changeProps);   
            } 
    

    function RTXT(target, findProps, changeProps)
    {
    app.findChangeTextOptions.caseSensitive = true;
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences.properties = findProps;
    app.changeTextPreferences.properties = changeProps;
    app.changeTextPreferences.properties = changeProps;
    target.changeText();
    }
    

    You must call the function RTXT repeatedly as well:

        var findProps, changeProps;

        findProps   = { findWhat:"Distributed by "};

        changeProps = { changeTo:"Distributed by. "};

        RTXT(target, findProps, changeProps);

        findProps   = { findWhat:"Distribué par "};

        changeProps = { changeTo:"Distribué par. "};

        RTXT(target, findProps, changeProps);

        findProps   = { findWhat:"Distribuido por "};

        changeProps = { changeTo:"Distribuido por. "};

        RTXT(target, findProps, changeProps);

  • help text replacement

    IAM having a query
    select enkuiri.cara_lelong, DECODE ( enkuiri.cara_lelong, 'A', lelong.HARGA_BIDA,'B', enkuiri.HARGA_BIDA ) tab from lelong , enkuiri
    If it satifies 'A' wat should I display in my report hard coded text is

    Bahawa & < enkuiri.harga_rizab > bagi Maksoud ITU.

    OrElse if she satisfied 'B' wat should I display is

    Harga bagi Farouk jualan itu hendaklah rizab Bahawa & < enkuiri.harga_rizab >


    How to do so

    Why don't you use simple concatenation like that?

    select enkuiri.cara_lelong, DECODE(enkuiri.cara_lelong, 'A', 'bahawa '||lelong.HARGA_BIDA||' bagi maksud itu.','B', 'bahawa harga rizab bagi maksud jualan itu hendaklah '||enkuiri.HARGA_BIDA ) tab
    from lelong , enkuiri
    ....
    

    -Clément

  • Change the text using script

    I am new to scripting and still so much to learn to please bear with me. I worked on a script that will allow me to update the information of slug on the files I work with on a daily basis. I use a combination of scripting and actions on my documents that clean the documents, but aussient to fill specific information for each document. As I learn more about scripts, I could consolidate my scripts and actions.

    Currently, I am working on the selection of specific text frames based on what their note value is using this code:

    var textFrames = activeDocument.textFrames;
    
          for (var i = 0 ; i < textFrames.length; i++)
            if (textFrames[i].note == "JOBNAME") {
              var frameName = textFrames[i].contents = "JOBNAME";
        }
    
    

    Here is a small list of items I would change

    Screen Shot 2013-09-06 at 11.33.07 AM.png

    I can go about it the wrong way, but my ultimate goal is to run a script that runs through each text field, and a dialog box allows me to enter text, then it is replaced by what is entered in the field of dialogue.

    It may be easier to create a dialog box that has all the fields and allows me to enter the value for each of them, but as I said, I'm new to scripting and don't know how to do this.

    I tried to enter my slug information using variable data, with spreadsheets, but I need to convert the xml spreadsheet and I have a lot of luck with that. I found that the use of variables in illustrator can be a little tricky.

    In the end, just trying to simplify my work and make things more efficient. In the process, I would like to know as much about the scripts as I can.

    Thank you

    This should help you get started with the change of name based on the note, with the help of guests

    var textFrames = activeDocument.textFrames;
    
    for (var i = 0 ; i < textFrames.length; i++) {
        if (textFrames[i].note == "JOBNAME") {
            var jobname = prompt ("Enter JOB NAME", "Your Name", "Note Changer");
            textFrames[i].contents = jobname;
        }
    }
    
  • When I try to open my mail in firefox it gives only the following text, which can help me? Thank you

    < content meta = "no-cache" http-equiv = "pragma" >
    < content meta = "no-cache" http-equiv = "Cache-Control" >
    < content meta = ' met Telfort's webmail good u uw E-mail all op elke computer die gorgeous puts internet.» Name of journal in the box e-mail op uw puts uw username in top. "="description">
    < content meta = ' webmail, mail, e-mail, email, mailbox, mailbox inloggen, e mail, webmail.telfort.nl, mailserver, tiscali mail, 12move mail, telfort webmail, webmail, webmail, mail server, web 12move tiscali mail "name ="keywords">
    < title > Telfort Webmail < /title >
    < script type = "text/javascript" >

    Try preventing the use of the cache by (while on the e-mail page) by clicking on the keyboard CTRL + F5 keys.

    If that does not work then clear the cache and if necessary also to delete all the cookies for the site by e-mail.

    You are apparently on an old version and not supported in Firefox. It isn't safe. The current version is Fifrefox 10.0.1 I suggest that you upgrade. The help option is probably the easiest method

    • Help-> check for upgrades on Firefox

Maybe you are looking for

  • VM085UA #ABA: HPcasInotification error

    When I restart my computer, I receive the following error message; 'HPcasInotifcation' has stpped working.  Please advise on how I can solve this problem.

  • writing unique to the digital port

    Hi all A little embarrassed to ask, but I have a simple question. There is, BTW, a general document on DAQMX help pages not only. I always miss the big picture and you have to look in the examples. It works also long examples correspond to your goal,

  • Windows Explorer memory increases during the night

    Hi all I had a problem with Explorer windows for 3-4 weeks.  I don't have any problems during the day when I am on my PC, but the problem starts in the night (at any time after 01:00). Particularly explorer.exe in my task manager would eat more than

  • (Redirected) Blue screen every time that I boot

    Whenever I start the dimension 3000 after approx.5 in 10 minutes, I get a blue screen showing options memory BIOS disable such as caching or shadowing. I also have a code.with to stop a series of zeroes and f I've not been able to get anywhere with t

  • spend my Vista Home Basic Edition CAREB that it came with

    OK, here's what I, an aspire5515 CAREB, it came with windows vista home basic, I bought windows xp, I want to install but I don't know exactly how do I have everything backed up on disk and ready to make the change but don't want to make a mistake an