Setting findTextPreferences is not working

10-11  Source: Network gathering  Views:2 

Advertisement
Hi!
I have an old script (written in javascript) we developed for InDesign CS3.
It worked in that version of InDesign.
Now we are moving to InDesign CC, so I started to adapt that script.
It seems script is stopping in the following line of code:
app.findTextPreferences = NothingEnum.NOTHING;
Does anybody know what is going on?
I am printing to console to be sure it is this line. Here it is the code:
$.writeln('remove: A');
        $.writeln(typeof app.findTextPreferences + ' - ' + typeof NothingEnum.NOTHING);
        app.findTextPreferences = NothingEnum.NOTHING;
        $.writeln(typeof app.findTextPreferences + ' - ' + typeof NothingEnum.NOTHING);
        $.writeln('remove: B');
        app.changeTextPreferences = NothingEnum.NOTHING;
        $.writeln('remove: C');
        app.findTextPreferences.appliedCharacterStyle = THEMATIZATION_STYLE_NAME;
        $.writeln('remove: D');
        app.changeTextPreferences.changeTo = '';
        $.writeln('remove: E');
        myParagraph.changeText();
        $.writeln('remove: F');
        app.findTextPreferences = NothingEnum.NOTHING;
        $.writeln('remove: G');
        app.changeTextPreferences = NothingEnum.NOTHING;
        $.writeln('remove: H');
The output in console is:
remove: A
object - object
I have to admit it is very discouraging to work with Extend Script.
I expected this version to improve some issues and my feeling is that it did not happen.
And what is worse, some things have stopped working.
Thanks for your help.
Kind regards!
That line app.findTextPreferences = NothingEnum.NOTHING works ok for me. You could also try app.findTextPreferences = null; but as that is a mere variant it probably won't work for you either. Output to my console is (in CS6 and CC):
remove: A
object - object
object - object
remove: B
remove: C
remove: D
remove: E
remove: F
remove: G
remove: H
(after deleting the lines referring to your character style and paragraph).
Did you try deleting your preferences?
Peter
Related articles
  • Setting findTextPreferences is not working 10-11

    Hi! I have an old script (written in javascript) we developed for InDesign CS3. It worked in that version of InDesign. Now we are moving to InDesign CC, so I started to adapt that script. It seems script is stopping in the following line of code: app

  • I just upgraded to the New OS on my Mac Book Pro and now my trackpad does not zoom in or out.  I looked at system settings on trackpad and it is set, but does not work How do I get it started? 10-11

    I just upgraded to the New OS on my Mac Book Pro and now my trackpad does not zoom in or out.  I looked at system settings on trackpad and it is set, but does not work How do I get it started?This is really unfortunate. I'm sorry that nothing works.

  • SET/GET Parameter not working? pls hlp 10-11

    hi i am using a transaction variant on transaction LT01 - create transfer order. using the transaction variant i have greyed out 3 fields on the initial screen. for the greyed out fields i am passing the values using a SET PARAMETER. This is working

  • Flickr set up does not work 10-11

    When I try to upload a photo to Flickr this message keeps appearing: "Do you want to set up iphoto to publish to flickr?" I have followed the set up process a dozen of times, but iPhoto keeps asking the same question. In Flickr I can see the per

  • E2000 setting priority is not working for one PC 10-11

    my home has a max download speed of 300 KB/s. which can make gaming quite an issue if someone in the house starts using something that is a bit of a drain on the bandwidth. i fixed the issue for a few months by setting the gaming console to be the on

  • Version sets in 12 not working correctly 10-11

    Do other people have an issue in Photoshop Elements 12 with it not consistently saving photos in version sets?  someties it works correctly and somethimes it doesn't and it also bumps me out stating it is a new photo.  i do have it configured to alwa

  • Setting postScript is not working 10-11

    Hi, Am trying to set the postscript level 3 to the files using javascript. but it's not working. here is my code: saveoptions = new EPSSaveOptions; saveoptions.postScript = EPSPostScriptLevelEnum.LEVEL3; the above code is not working in adobe illustr

  • Despite my spell check being set, it does not work in Hotmail and some other websites. 10-11

    I have the setting for spell check set up but it does not work on some sites like hotmail. I go to the spell check button in hotmail and it tells me that my browser will automatically check as I type but it doesn't. I've searched to override this or

  • My iphone's setting menu is not working.plz help me 10-11

    When i enter into the setting tab all the menu is not working i cant eneter to any item there or even i cant scroll down.plz help meTry hard resetting the phone. Hold down the sleep/wake button and the home button at the same time until the apple app

  • Setting Workflow status not working in imported workflow from SPD to Visual Studio 10-11

    Hi all, I have created SPD workflow and imported in visual studio. When I deploy imported Workflow using visual studio feature I found that Setting Workflow Status action is not working. Do I need to change Set Workflow status activity in Visual stud

  • SSO using spnego set up but not working for an Enterprise Web Service 10-11

    Hello, I am looking for some guidance. I have a function module that is exposed as a web service. I am trying to be able to access the web service with sso so the user does not need to logon. Systems has set up SSO using spnego to issue sap login tic

  • Webcam setting 1.0 not working 11-30

    i just bought webcam setting from App store and it not working fully the exposure mode is not enable and focus option is not enable as well. can any one plz tell me why it isn't working . after all i bought then y it isn't working fully?Darksiders89

  • Set CLASSPATH does not work, how do I run java.exe? 11-30

    Hi guys, I have a problem running the java.exe and I'm using Win XP. Here is my problem: Under the command prompt, I set the path: path = C:\Program Files\Java 2\j2sdk1.4.2_05\bin Then I created a folder in E:\Hello. I save my Hello.java in that fold

  • OBIEE set up.exe not working 10-11

    Hi, I am trying to install OBIEE on my windows 2008 server Virtual machine. I have the BI zip files (Unzipped into one folder ) on my external hard drive. When I try to access the file and run the setup.exe on my virtual machine it is not working. Th

  • TS1347 I have about 200 contact number in my Sim but however I tried to sim import contact from the setting it is not working what is the solution to import my sim contact so it is so neccessary for me ? 10-11

    Dear all please help me ....Hi Been using my iPad3 with Reliance in Mumbai for nearly 3 months now. It works great other than the problem with the whole "request handset config" mess. The ONLY way to resolve is (in my expereince) is to hit cance

  • Setting dynamic text not working in AS2 10-11

    I'm working on a complex file given to me by another designer and I'm having a problem with being able to set dynamic text. Basically, I just want to set the text of a nested instance (e.g., with an instance called foo and a instance inside foo calle

  • Touchless set up is not working 10-11

    When prompted to record the launch phrase, it doesn't give me any time to actually say anything, it just immediately says "Sorry, I didn't catch that.  Let's start over and try OK Google Now again."  But when I press Start again, it does the sam

  • Adobe Set Up Installer not working 10-11

    I tried to install Adobe CS6 and for some reason, when I opened the Set Up.exe it said "We've encountered the following issues Installer failed to initialize." Then it advises me to donwload the Adobe support advisor to detect the problem. I've

  • Server set up still not working 10-11

    Trying to set up a new site in Dreamweaver. When I get to Server Setup I get this box, which has nowhere to click to specify a new server, etc. I was advised in an earlier post to click in the white area to the left to bring up some buttons, but can'

  • HP 8600 Printer setting changes do not work with internet explorer v11 and win7 10-11

    I can connect to my printer using my IP address in ie 11, and i can look at lots of things, but if i attempt to change something simple, like the time, i get an error message back that says invalid input.  However, if i use Firefox v26.0, it works fi