Using FindChangeByList Javascript

I read the excellent article in Nov 08 issue of InDesign Magazine on using FindChangeByList. I am publishing stories on the card game Bridge which uses symbols for Hearts, Spades, Diamonds, and Clubs. I would like to use a script that replaces easily-typed characters for the suit symbols and makes the Hearts and Diamonds red. I have managed to write a script that replaces the symbols, but cannot find a way to make some of them red. Or better yet, applies a Character Style. Below is my script. Can anyone help me change the Hearts and Diamonds to red?
glyph
{glyphID:4,appliedFont:"Times",fontStyle:"Regular"}
{glyphID:386,appliedFont:"Apple Symbols",fontStyle:"Regular"}
{includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:false}
Find all exclamation marks and replace with clubs.
glyph
{glyphID:7,appliedFont:"Times",fontStyle:"Regular"}
{glyphID:383,appliedFont:"Apple Symbols",fontStyle:"Regular"}
{includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:false}
Find all exclamation marks and replace with clubs.
glyph
{glyphID:6,appliedFont:"Times",fontStyle:"Regular"}
{glyphID:388,appliedFont:"Apple Symbols",fontStyle:"Regular",appliedCharacterStyle:"Red Suits"}
{includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:false}
Find all pound signs and replace with hearts.
glyph
{glyphID:35,appliedFont:"Times",fontStyle:"Regular"}
{glyphID:389,appliedFont:"Apple Symbols",fontStyle:"Regular",appliedCharacterStyle:"Red Suits"}
{includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:false}
Find all at marks and replace with diamonds.

Hi Gary,
The findChangeTextOptions are included in the FindChangeByList.txt file--the organization of each line is:
type|tab|findWhat|tab|changeTo|tab|findChangeOptions|tab|comment
So a typical line for a text find/change operation looks like this (where <tab> is a tab character):
text<tab>{findWhat:" - "}<tab>{changeTo:"^="}<tab>{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}<tab>Find all space-dash-space and replace with an en dash.
You would add:
caseSensitive:true<pre>
...to the find change options section of the line.
Thanks,
Ole

Similar Messages

  • Problem setting paragraph style using FindChangeByList

    am trying to apply a paragraph style using FindChangeByList. I can apply character styles but not paragraph styles.
    I need to apply the paragraph style "price" to every paragraph that begins with a "$"
    I have tried it everyway I can think of.
    any suggestions?

    Hi Carolyn,
    Try something like this (assuming JavaScript, and also assuming that the paragraph style is not in a paragraph style group):
    text<tab>{findWhat:"$"}<tab>{appliedParagraphStyle:app.documents.item(0).paragraphStyles.i tem("price")}<tab>{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    (Where <tab> is a tab character.)
    Thanks,
    Ole

  • FindChangebyList JavaScript hangs on line 160

    Hi, I'm using InDesign CS5.5 on a Mac OS X 10.6 Snow Leopard. In trying to use the "FindChangebyList" Javascript, I'm finding that it hangs on line 160. See screen shot:
    The following is the text search I've added to the "FindChangeList.txt" document:
    text
    {findWhat:"", appliedParagraphStyle:"C"}
    {changeTo:"", appliedParagraphStyle:"qin-hed"}
    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    Finds para style "C" and replaces it with para style "qin-hed".
    I'm searching for a certain paragraph style and replacing it with another. Should be simple, but the Javascript hangs. I've been careful to add the proper Javascript name to the script ("2parasweep.jsx") and the name of the FindChange text document ("2parasweepList.txt"). The FindChange text doc is inside the "FindChangeSupport" folder and the proper path is indicated in the Javascript.
    What's going wrong here?
    Gary

    (Generally speaking, when a script produces an error, we don't call that a "hang." The word "hang" is reserved for when the program just stops responding with no feedback or error condition.)
    I...don't think we have quite enough information to determine the problem. I assume that if you change your findWhat and changeTo strings away from null strings, the problem does not go away? If it does not go away, please upload your two files to http://pastebin.com/ (or otherwise make them available) and post a link here. If it does go away, well, hrmm.

  • How to open an URL and close the URL window, using adobe javascript

    Hi,
      Is it possible to open an URL and close the URL back again(without allowing the user to perform any other operation)? I was able to acheive the opening of the URL, using the app.launchURL("address". true); - But here it lauches in new window, and how do i close the window using the javascript. Is it possible?
    Thanks.

    Hi all
    In addition to what Bobby W - Adobe TS added, you might find
    the following useful as a bypass or workaround to the pesky prompt.
    var pw=window.parent;pw.opener=window.self;window.open("
    http://www.adobe.com");
    pw.close();
    I think this will only work for IE browsers. Actually, I
    think the whole window.close() only works for IE, but could be
    wrong about that.
    Cheers... Rick

  • Using browser javascript to copy selected text from a pdf file opened in Air app.

    I have posted this question on reader forum as well, but I think it is more suited here...
    I am trying to create a note-taking application in air. I want to extract selected text from pdf file as a string object or to the clipboard.
    Obviously, all pdfs in my local storage will not be scripted to recieve postMessages and act accordingly, and that is not practical either. So, my problem is, how can I copy the selected text in the pdf file (opened as an object in htmlloader within my Air app) to clipboard or directly in another control by say clicking a button in air application? I suppose, this is possible using javascript, however, I don't know which reader methods are exposed to the wrapper htmlloader control. In short, I want to execute app.execMenuItem("Copy") command through htmlloader javascript. Any alternate solutions are also welcome.
    This is similar to passing inbuilt commands/methods/functions (of adobe reader) to pdf-reader plugin embedded in a webpage via javascript. This is possible in IE where the pdf is rendered as activex object, and hence JSObject interface of pdf document/reader is accessible to the browser javascript. I have also read that this same JSObject is accessible to VB as interface for IAC, so as the Air is Adobe's own product, I was wondering if equivalent of JSObject is accessible to htmlloader control as well.
    Thanks in advance...
    Mits

    Thank you Thom for your reply...
    from
    http://www.adobe.com/devnet/acrobat/javascript.html
    ...Through JavaScript extensions, the viewer application and its plug-ins expose much of their functionality to document authors, form designers, and plug-in developers...
    As it is explicitly mentioned, that the functionality of adobe reader are exposed for plugin development, I thought someone here might have used external javascript to execute some safe methods in adobe reader. The functionality (i.e. external javascript interface-JSObject) is already available for VB programmers to develop IAC. Further, the Acrobat SDK example called "AcroPDFinHML" shows how one can embed a pdf-reader in a html page and execute some safe methods (like gotonextpage(), zooming etc.) in IE as ActiveX plugin. I have checked it myself for adobe reader 9, and it works perfectly, so there is no security issue as such to implement the same for another browser (like in my case, the htmlloader control in flex/air app).
    I intend to create a note taking application in air, where it is very much required that I should be able to copy selected text from various pdf documents, that are open in my app, and subsequently paste/collect/save the collected notes and process them afterwords (offcourse, from the pdfs that allow me copying text). However, it is not happening for me here. As the pdfs are opened through adobe reader plugin, it does not register the copy command executed by my air app. It registers the system level copy command (by keyboard shortcut Ctrl+C), but my air app has no way to execute the system level copy command programmatically. So I am kind of stuck here...
    Thanks again for your reply. Having known what am I intend to accomplish, any other (may be alternative) solutions will be appreciated nonetheless...
    Mits

  • How to make use of javascript functionality in WD application?

    hi,
    I want to use some javascript functionality in my web dynpro application.
    This is my requirement:
    I want to design templates for User's ID card.
    For that , I need to use label, image area, headings in that template as drag and drop objects(so that we can move the lable, image fields whereas we want in that template area).
    We have already done this scenario by using javascript.
    How could it be possible in web dynpro?
    Can I use the existing javascript in my WD application?
    Anyone Pls suggest me.
    Thanks.

    hi Abdul,
    in addition you could read documentation on the popupmenu, you can find here:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/de/416d42ab7fd142e10000000a1550b0/frameset.htm
    BTW: This only works for NW2004s (-;
    Kind regards
    Stefanie

  • Security flaw-To use CSOM/Javascript code for Custom Office365(Sharepoint Online) application

    Hi,
    I've developed custom application in Office365(Sharepoint Online) using CSOM/Javascript. Security team from client side has been reported one major issue to the our application that any end user can comment our CSOM/Javascript code and bypass the validation
     or can update / insert into sharepoint list item using developer tool/ Console in Google Chrome(F12 Key).
    Also end user can write his own separate code in console of Google Chrome (Developer Tool / F12) and can update / insert  into Sharepoint List.
    Note:- End user has Add, Edit, View permission on all Sharepoint List.
    This is one major security flaw of the Sharepoint/Office365 to use CSOM /Javascript for writing code, to overcome this issue could you please provide me some solution.
    Your help would be greatly appreciated!!!  
    Looking for reply.
    Thanks,
    Mahesh Sherkar
    Web: http://Mahesh-Sherkar.com
    Email: [email protected]

    Hello Paras, 
    Did you get any solution for this? I think your website was implemented this form. Can you please tell me the way how I can achieve it? I am also facing same problem. Please reply me as early as possible.
    Thanks,
    Mihir

  • Using "Execute Javascript" to mark a course as Complete. 

    I am using a 3rd party Flash-based player (Flashform) to
    bundle Captivate and Flash made SWF files into a SCORM 1.2 package.
    My final SWF is a Captivate assessment, which, if passed, should
    change the course lesson status to “completed”. Can I
    accomplish this by using “Execute Javascript” on a
    button and run something like:
    “FSCommand("LMSSetValue","cmi.core.lesson_status,completed");”
    Any advice is greatly appreciated.
    Jon

    If you were using only the Captivate-published files for
    SCORM, it would likely be fairly straightforward to do what you're
    looking for.
    Unfortunately, since you're using a 3rd-party player, you'll
    have to consult the documentation for the player to determine which
    capabilities it exposes and how you can access those capabilities.

  • Connect database using ext javascript or applescipt in indesign

    Hi,
    I need to connect oracle database using extended javascript or apple script in indesign. Can somebody help by giving any suggestion. Or is there any possibility to connect database using the two scripting methods.
    It  is really urgent.
    Thanks
    Karthik B

    ExtendScript has a Socket object prototype you can use to e.g. connect to the internet. Calling a web service would probably be more elegant than addressing the database directly. Socket is fairly low-level, though. If you need something easier, you could always try out http://extendables.org/docs/packages/http/doc/readme.html
    I seem to recall some InDesign plug-ins you could buy that allow you to connect to a database directly, but you'd have to google that yourself.

  • How to read a text file using adobe javascript

    Hi,
    I have a api application which adds toolbar to a adobe acrobat. i need to disable the toolbar according to expiry date, So i need to fetch the expiry datge from a text file from the specified location.
    I am using importTextData() function to get the textdata from text file using adobe javascript. When i call this function i am getting error "ReferenceError: importTextData() is not defined".
    I am using Adobe Acrobat 7.0 version.
    Can any one tell how to use the importTextData() function.
    Regards
    Shiva

    calling from javascript file which is placed in the below location.C:\\Program Files (x86)\\Adobe\\Acrobat 7.0\\Acrobat\\Javascripts
    Regards
    Shiva

  • Use of JavaScript in Adobe Forms

    Hi guru's...
    Are there any restrictions in the use of JavaScript Coding within Livecycle Designer?
    Which objects, methods and/or functions can be used and which can't?
    Is there a reference guide for this?
    And is there a way to use some kind of debugging for testing the JavaScript code within an Adobe Form?
    Thanks in advance
    Wouter Heuvelmans
    SABIC Europe SAP Competence Center

    Hi,
    You can learn JavaScript(use it as reference) from this site...
    <i><b>http://www.w3schools.com/</b></i>
    And coming to restrictions...I dont find as such any till now in my usage...
    I used to use ALERTS for DEBUGGING purpose...
    Here is some sample coding...
        <i>var strText = "Raja";
        alert("Hello Javacript"+strText);</i>
    Regards,
    <i><b>Raja Sekhar</b></i>

  • We tried the window.ResizeTo and window.MoveTo methods using the javascript. It doesn't seem to be working in the version 9.0.1. Please suggest any alternative .

    Hi,
    We tried the window.ResizeTo and window.MoveTo methods using the javascript. It doesn't seem to be working in the version 9.0.1. Please suggest any alternative .
    Thanks,
    Avinash

    This is no longer allowed for security reasons (bug 565541).<br>
    See https://support.mozilla.org/nl/questions/880032<br>
    https://developer.mozilla.org/en/DOM/window.moveTo<br>

  • Is it possible to change out of the box Callout content for already existing library using some javascript API ?

    Is it possible to change out of the box Callout content (change DOM elements) for already existing library using some javascript API?
     API ?

    Hi,
    We can use CSS and jQuery to achieve it.
    Please add the following code into the Content Editor Web Part.
    <style type="text/css">
    .js-callout-content{
    display:none;
    .js-callout-mainElement span{
    display:none;
    .js-callout-mainElement{
    border-width:0px;
    </style>
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    $("a[title='Open Menu']").click(function(){
    setTimeout(function(){
    $(".js-callout-body .js-callout-bodySection").eq(0).html("<span>Test</span>");
    $(".js-callout-mainElement span").show();
    $(".js-callout-content").show();
    $(".js-callout-mainElement").css("border-width","1px");
    },1000);
    </script>
    Result:
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Examine Document... using Acrobat javascript

    Hi,
    I am using Acrobat 9 version.
    I have a pdf which has some hidden text. I am using Acrobat menu  Document -->Examine Document... to find if the PDF has any hidden text or not.  If the Examine Document... shows the Hidden text (1 page), then I remove the hidden text using Remove button at the bottom of the examine status window.
    My question is, it is possible to do this task using Acrobat Javascript.
    I am having more than 500 PDFs, so opening each and evert PDF and examining the documnet takes more time. If there are options in Javascript, please let me know.
    Thanks,
    Gopal

    Thanks for your reply.
    The preflight option "List invisible text objects" does not generate the report saying that the PDF has invisible text objects.
    Also, "PDF names"means name of the PDF document (Ex: sample.pdf). Is there any way to achieve this using Javascript code?
    Thanks,
    Gopal

  • How to execute preflight profile using Acrobat Javascript

    Execute a pre-flight profile using acrobat javascript and  call that function in VB.Net.

    See: http://help.adobe.com/livedocs/acrobat_sdk/10/Acrobat10_HTMLHelp/wwhelp/wwhimpl/common/htm l/wwhelp.htm?context=Acrobat10…

Maybe you are looking for

  • Sale Order Status after dellivery of materials from Projects

    Hi, I have ETO sccenario which consists of all modules such as SD,PS.PP etc. Materials will be procured from external vendors & manufactured inhouse through project systems. After delivery of materials from project systems, billing & invoicing will b

  • Cannot Connect to Oracle, PHP cannot load oci dlls

    Hello, I have installed wamp on windows server, and oracle 9, When I try to connect to oracle in php I get: Fatal error: Call to undefined function oci_connect() in C:\wamp\www\project2\index.php on line 3 Also when I start wamp, it cannot load the o

  • PI sheets - PPPI_RESERVATION_ITEM

    Hi, I am looking to create a PI sheet with Batch determination.  I can use CONS_BDS Process Message but it asks me for a value for PPPI_RESERVATION_ITEM and I thought this would automatically come from the reservation? Is this not the case ?  How do

  • Movement type related question

    Hi, What is the difference between movement type 413 and 412 with special stock indicator E? An explanation with an example would help.

  • Standard Code in NWDS vanishes

    Hi, I am using NWDS 2.0.13 which is downloaded from Service Market Place recently.When I do the UI designing and press "Save All MetaData" all the standard code which is generated by the NWDS in my implemetation tabs gets vanishes. Can anybody says w