Problem with script for the font change

Hey guys,.

You have a problem here and it has completely baffled me.

I have two scripts;

Change the list of fonts of Arial roasts in the entire document,
And the other to do exactly the same thing in the paragraph styles.

One that modifies the document works very well, one that runs through paragraph styles does not work. It simply changes all fonts that never entered last in the script.

I downloaded a zip container file:

1: arial fonts

2: Rotis Fonts

3 inDesign Document with paragraph Styles

4: two JavaScript scripts to change fonts

Zip file location: http://www.sbdigitalservices.com/transfers/ScriptProblem.zip

Any help would be appreciated more that I tried to solve this problem for a few days with no joy!

LittleMookie

[Jongware] wrote:

It should be

If (app.activeDocument.paragraphStyles.appliedFont == app.fonts.item ("Rotis Semi Light Sans\t45")

app.activeDocument.paragraphStyles [i] .appliedFont = app.fonts.item("Arial\tNarrow");

In fact, the [i] has been replaced by the sign...

It should be:

app.activeDocument.paragraphStyles[i].appliedFont == app.fonts.item("Rotis Semi Sans\t45 Light")

I would have written it totally differently (it interacts with InDesign much much less!):

var doc = app.activeDocument;
//var paraStyles = doc.paragraphStyles;// you don't want to do this if there's a chance of style groups...
var paraStyles = doc.allParagraphStyles;// You want this instead!
var fonts=app.fonts;

for (var i=2; i 
         

Tags: InDesign

Similar Questions

  • Problem with script on the master page

    So I have my build script of the unique number bit that I have posted here before... it's on the Initialize event of the field.


    If (this.rawValue == null) {}
    var d = new Date();
    this.rawValue = parseInt(d / 1000);
    }
    else {}
    this.rawValue = rawValue;
    }

    Which works very well if on the body of the form, but if I put it on the master page it re - initializes (and changes the number) whenever a subform gets shown/hidden. No idea how to stop it from doing this? I tried it on a few other events without a bit of luck.

    I came across another problem with this script, a field called 'Date' was interfering with the script - throw an error "the Date is not a constructor. Is - this normal (function/field collision)?

    Hi Jono,

    I had problems with script within the Master pages before. What I've done in the past, it is a textfield hidden in the main pages of script with overall binding (which featured many here today); then same name textfield in the master page picks it up.

    Good luck

    N.

    Post edited by: Niall O'Donovan

  • Problem with pdf for the opening of the health gov Web site.

    Problem with pdf for the opening of the health gov Web site. I use my ipad in Safari and have installed the application to adobreader. Healthcare gov support only suggested to disable the pop-up blocker. I did, and I couldn't always open the file. No problem on a desktop computer regardless of the browser.

    In my view, they spend on their web server to a document ECM server authentication. Someone else has the problem?

    I tried the Penguin, Chrome and Atomic browsers on the ipad and the same issue.

    Thank you!

    Keren

    Okay, actually, I think that there is a problem with the type of form. It is a form of a special kind (called a form XFA or Designer, for what it's worth), which can be opened with Adobe Reader and only on Mac or Windows. There is no iPad software that can read these.

  • Problem with navigation of the fonts in Illustrator

    HI, I just downloaded a large number of fonts to use for a logo design for free
    I have never had any real problems with the fonts in Illustrator (I use CS4 on PC)

    but some (10%) of these (new) fonts does not work properly in illustrator (works fine in Flash, InDesign and Photoshop)
    which means that when I browse through fonts it often happens that the selected font jump to the police either first or last in the system
    (which is really boring and steals a lot of time)
    I know I could do the (very) hard and simply eliminate a police every time I meet the problem, but it would be extremely time-consuming
    (I have about 3000 fonts now, 30-40 are commercial fonts, the rest are free fonts, downloaded from the web).

    ideas, solutions, comments?


    NOTE: 'Normally' I use Flash to browse the fonts for these types of jobs (is the best and don't crash, jump or spoil)
    but it would be great if I could work with illustrator too (what I sometimes when you use categories with many filters/effects)

    The best

    M6

    *************************************

    You are browsing the fonts with the arrows on your keyboard?

    Turn off "enable protection of glyph" in preferences

  • Problems with Vista for the bases of x 64 systems (KB2753842) updated

    After the Vista (KB2753842) to update my sidebar and the task bar bottom turned white.  They were clearly before the update.
    I rolled back the update and the return to a light background.
    The next time I turned on the computer, auto update installed (KB2753842) and the white background returned.
    Then I disabled the update of the automatic system and uninstalled the update (KB2753842).
    The taskbar and sidebar are back to normal. (clear)
    Is there another way to solve this problem?

    PA bear,

    I have successfully completed the list, except article 11 c. For good measure, clear your Java cache by http://www.java.com/en/download/help/plugin_cache.xml I was unable to search and find the Java Control Panel by the link above.

    The KB2753842 is listed in the list of installed updates and my problem with the white background in the sidebar bar and the stain was gone!

    Of Kudo and thanks a lot for your advice and help.

    I now intend to start the automatic update of the window.

  • problem with webcam for the HP 3125 basic model

    Hey readers, I've got this beautiful model HP 3125 basic and has a webcam at the top of the screen but could not find any original progams HP for this, also could not find it in download drivers, anyone know a camera trust hp progam, please help, thank YOU!

    Hello:

    It is the most widely used software for the webcam in HP laptops.

    http://h10025.www1.HP.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-109796-1&cc=us&DLC=en&LC=en&JumpID=reg_r1002_usen_c-001_title_r0008

  • Problem with deletion for the folder of blackBerry Smartphones

    I try to organize my main screen to make that less cluttered. I created a new folder to store some of my apps in and called "Social Networking". I then he assigned an icon. I tried to move the YouTube app in the folder, and it reproduces itself. I can't remove the duplicates. I have restarted my unit, renamed the folder (which is only created yet another folder with the new name I could remove, but the troublesome file is still there) and I tried to move the folder. When I try to access the folder, nothing happens. I have 6 and updated OS up-to-date shortly after obtaining the unit on Halloween a few days ago. I got the camera from Sprint.

    Fixed it myself.

    1. Turning the phone off.
    2. Removed the battery.
    3. Waited a few seconds.
    4. Put the battery back in.
    5. Phone restarted itself. (Some phones may require you to do it yourself.)
  • I have the ie3sh.exe problem on my laptop, can you tell me what I have to do and this causes a problem with LAN for internet

    I have the ie3sh.exe problem on my laptop, can you tell me what I need to do, and this causes a problem with LAN to the internet.  What happens on another laptop not this one.

    Hello

    ·        Which is exactly the problem that you face with iesh3.exe?

    ·        When you receive the error message that is related to iesh3.exe?

    ·        You did changes to the computer before the show?

    ·        This issue you are facing with internet?

    ·        What is the full error message that you receive?

    Method 1: I suggest you to run the Microsoft safety scanner to ensure that the system is free of infection by the virus:

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Method 2:  I would say as you put the computer to boot and check which application is causing the problem:

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

    Note: after a repair, be sure to configure the computer to start as usual as mentioned in step 7 in the above article.

    Post back with the required information so that we can help you further.

  • Hey there, I have a problem, I paid for the creative cloud each month. 30 days ago, I downloaded the new update only in the trial version of photoshop and today the trial version has expired and I could not work with my old adobe program, although I pay f

    Hey there, I have a problem, I paid for the creative cloud each month. 30 days ago, I downloaded the new update only in the trial version of photoshop and today the trial version has expired and I could not work with my old adobe program, although I pay for it.

    Aileen,

    Please see suggestions here: FAQ: what should I do if I have a subscription, but my application acts as if I had a trial?

    Kind regards

    Guinot

  • I had endless problems with Lightroom since the purchase of subscription for one year in December 2014. Now, the development Module was disabled, as they claim that my subscription has expired...  He spent more time to work does not, and I'm bitterly briv

    I had endless problems with Lightroom since the purchase of subscription for one year in December 2014. Now, the development Module was disabled, as they claim that my subscription has expired...  He spent more time to work does not, and I bitterly regret it.  Help, please!

    Open the Adobe Creative Cloud application then go to preferences then sign out and then sign back with the same Adobe ID that you used to purchase the subscription photographers, that is to say the same e-mail address and password.

    Then open Lightroom and go to the Help menu and make sure that it is signed in with that Adobe ID email address.

  • Strange problem with measurement of the color under Mac.

    Hello, I have a strange problem with measurement of the color under Mac. For example I create a gradient in Photoshop color 200 200 200 color 240 240 240. When I measure the color of the gradient with the Photoshop color measurement tool or with the built in OS X color measurement tool measured color is of 200 199 197 to 240 240 238. I measured the same gradient with Photoshop for PC and the values are OK (the same values that I create).

    I don't know what the problem is, but I think that the colors that I create are the same I have measure after creating them and also values between Mac and PC. I appreciate much help or information you could give me that helps me understand what is happening here.

    Thank you for your time

    Marcelo.

    Yep, you guessed it, evidence as monitor basically removes all profiling and just offer it right.

    is it possible to make the OS X color measurement tool to measure the original color values

    You mean the colors of paper - No., as I said photoshop filter your image through the profile document, proof of installation and the monitor profile. Why use Digital color meter for this though?

    I don't understand what is measurement of color values that will change every time point calibrate it my monitor.

    Because color values are "larger" what is on your monitor. Your monitor (via photoshop) makes only the best he can to display these values, which can be anything from LAB colors outside the range of your monitor - to the CMYK color. Calibration, it is the only way to allow your monitor to do this in any way accurately. (never really impossible) The monitors have a certain range and are only representations / would the REAL colors who is the holder of a document, with a profile. There's only one good reason to measure the monitor values so that is to build a monitor profile.

  • problem with Safari and the opening of sites

    problem with Safari and the opening of sites

    Please describe the problem in more detail?

    Try to reset the settings of Safari:

    1. open Safari

    2. click on the Safari menu at the top (to the right of the Apple logo)

    3. Select the Preferences/Privacy tab

    4. click on remove all data from the Web site

    5. close Safari.

    Remove cache Safari files:

    1. click on finder

    2. look for the menu GO to top

    3. click on GO and hold down the option key. This will show a user library folder.

    4. click library and find the Caches folder

    5. in the folder caches com.apple.Safari Ouvrezledossier

    6. move the Cache.db file Trash.

    This should solve the problem. If it does not help, try to disable the Safari extensions

    1. open Safari

    2. click on the Safari menu at the top (to the right of the Apple logo)

    3. Select Preferences

    4. find the Extensions tab

    5 disable all extensions of

    6. relaunch Safari

  • a problem with one of the files in the TestStand\AdapterSupport\LabVIEW directory

    When looking at the module a LabVIEW VI called for TestStand, I get the following message:

    A problem with one of the files in the TestStand\AdapterSupport\LabVIEW directory.  Please reinstall or repair.

    I made the mistake of cleaning C: in my computer.  Clean the C:\National Instruments downloads

    Why would someone put bits of applications or modules, etc. in such a directory?

    I'm not too crazy about restoring 11FR in this folder.  It's just crazy!

    If anyone has encountered this before?  No "easy"? outside re - install TS...

    Side note: I do not touch anything in the \Program files. National Instruments\TestStand\AdapterSupport\LabVIEW

    What version of LabVIEW and TestStand do you use?

    In 2012, TestStand, this directory is mapped to:

    C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 2012\AdapterSupport\LabVIEW

    Have you tried mass compiling the screws in this folder?

    I had to create a new 'TestStand - default values XX.llb"file, where XX is the last version of LabVIEW you use, but I have not seen this message before.

    Good luck

    PH

  • problems with updates for Windows (for Win XP)

    I have problems with Windows (for Win XP) updates...
    (1) I installed the hardware updates for my sound card (via Windows update) and now I can't hear the music through my speakers or headphones.  In addition, related to my sound card software do not work either!
    (2) at the same time, I tried to install Microsoft .NET Framework 1.1 Service Pack 1 through Windows Update and that would not install (.. .and I tried several times).

    So to rememdy those issues, I tried for hours to use the system restore, but whenever I've tried I'm not able to successfully restore and I tried several unique restore points.
    Any suggestions?  I spent hours on it, and nothing seems to help!

    Hello hoke, welcome.

    1. What is the brand and model of your computer?

    Let us know if it works:

    1. download the .NET Framework here cleaning tool:
    http://blogs.msdn.com/astebner/attachment/8904493.ashx

    2. run the utility and remove all versions of the .NET Framework
    3. restart your computer

    ---
    After the reboot
    ---

    4. download the .NET Framework 3.5 from here:
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4e35-B531-508D977D32A6&displaylang=en

    5. next, restart your computer

    Let us know if it works,

    Thank you! Ryan Thieman
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Problem of CPU for the 90-100% svchost.exe

    When I bring my task manager, I see that svchost.exe has a really high CPU usage, it just started a few days ago and im not sure what is wrong. I tried updates automatic disableing and also I remember having the same problem with an older computer of mine, but I thought that I fixed it with the installation of an update for Windows XP (KB927891) called update can be found here http://www.microsoft.com/downloads/details.aspx?familyid=7A81B0CD-A0B9-497E-8A89-404327772E5A&displaylang=en

    I tried to install it but it tells me a new package system is already on it and there is no reason for this update. Does anyone know how to fix this?

    This problem is common for the windows operating system. I hope that this source will help you - http://fileinspect.com/fileinfo/svchost-exe/

Maybe you are looking for

  • Toshiba virtual Store account Reset - 16291

    HelloReset personal account 16291Thank you!

  • Pavilion 500-214: Bluetooth

    Hi aggian. I have a 500-214 with recently installed windows 10 Pavilion. I can't find Bluetooth. I have a Pavillion laptop, G7 (windows 10) with the same questions. Can I connect or what, I need to install it. Thank you again...

  • 2D interpolation

    I seem to have some difficulty to understand how the 2D.vi function interpolate My goal is the following: I have a 7 x 7 grid, which means that there are 49 items. Now I know values measured at 5 points and details their cartesion. For example _  _  

  • Waveform 1 d for daqmx base

    Hello.  I have a USB of NOR-9233 key I aquire card with.  I'm under Opensuse 10.3, Labview 8.5 and Daqmx Base 3.1.   Using DAQmxBase Read, I noticed that there isn't an option for 1 D Wave, only 2D DBL, under the analogue of the multiple samples.  Th

  • problems win7 dma2200

    my cable works fine with vista media center connecting the Extender and also on another connection from the win7 pc but my main pc connects for 1 second and then on the Extender, the screen goes black (sounds can be heard) and then, after a few minut