Professional Web Applications Themes

Mapping Word styles, any way to get rid ofthe + without Alt clicking each paragraph? - Adobe Indesign Windows

I typed this doent myself so the styles should be applied correctly. I tried this script Dave wrote: myStyles = ["Italic","Bold", "Bold Italic"]; myPosns = ["superscript","subscript"]; myPosnEnums = [Position.superscript,Position.subscript]; myDoc = app.doents[0]; noCharStyle = app.activeDoent.characterStyles[0]; for (var j = 0; myStyles.length>j; j++) { try { myCharStyle = myDoc.characterStyles.item(myStyles[j]); myCharStyle.name; } catch (e) { myDoc.characterStyles.add({name:myStyles[j],fontStyle:myStyles[j]}) myCharStyle = myDoc.characterStyles.item(myStyles[j]); } app.findPreferences = null; app.changePreferences = null; myDoc.search("", false, false, undefined, {appliedCharacterStyle:noCharStyle,fontStyle:mySty les[j]}, {appliedCharacterStyle:myStyles[j]}); } for (var j = 0; myPosns.length>j; j++) { try { myCharStyle = myDoc.characterStyles.item(myPosns[j]); myCharStyle.name; } catch (e) { myDoc.characterStyles.add({name:myPosns[j], position:myPosnEnums [j]}) myCharStyle = myDoc.characterStyles.item(myPosns[j]); } app.findPreferences = null; ...

Sponsored Links
  1. #1

    Default Mapping Word styles, any way to get rid ofthe + without Alt clicking each paragraph?

    I typed this doent myself so the styles should be applied correctly. I tried this script Dave wrote:

    myStyles = ["Italic","Bold", "Bold Italic"];
    myPosns = ["superscript","subscript"];
    myPosnEnums = [Position.superscript,Position.subscript];

    myDoc = app.doents[0];

    noCharStyle = app.activeDoent.characterStyles[0];

    for (var j = 0; myStyles.length>j; j++) {
    try {
    myCharStyle = myDoc.characterStyles.item(myStyles[j]);
    myCharStyle.name;
    } catch (e) {
    myDoc.characterStyles.add({name:myStyles[j],fontStyle:myStyles[j]})
    myCharStyle = myDoc.characterStyles.item(myStyles[j]);
    }
    app.findPreferences = null;
    app.changePreferences = null;
    myDoc.search("", false, false, undefined, {appliedCharacterStyle:noCharStyle,fontStyle:mySty les[j]}, {appliedCharacterStyle:myStyles[j]});
    }

    for (var j = 0; myPosns.length>j; j++) {
    try {
    myCharStyle = myDoc.characterStyles.item(myPosns[j]);
    myCharStyle.name;
    } catch (e) {
    myDoc.characterStyles.add({name:myPosns[j], position:myPosnEnums [j]})
    myCharStyle = myDoc.characterStyles.item(myPosns[j]);
    }
    app.findPreferences = null;
    app.changePreferences = null;
    myDoc.search("", false, false, undefined, {appliedCharacterStyle:noCharStyle,position:myPosn Enums[j]}, {appliedCharacterStyle:myPosns[j]});
    }

    myStyles = myDoc.paragraphStyles;
    app.findPreferences = null;
    app.changePreferences = null;
    for (var n = 1; myStyles.length > n; n++){
    myDoc.search("", false, false, undefined, {appliedParagraphStyle:myStyles[n]}, {appliedParagraphStyle:myStyles[n]});
    }

    But I'm looking for something that won't create the bold and italic charachter styles.
    Sponsored Links
    Fred_Goldman@adobeforums.com Guest

  2. #2

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    Move the fourth line of the script and the last six into another text file.

    Voila.

    Dave
    Dave_Saunders@adobeforums.com Guest

  3. #3

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    OK I tried that and I got an error that myDoc is undefined on line 12.

    This is what I used:

    myStyles = ["Italic","Bold", "Bold Italic"];
    myPosns = ["superscript","subscript"];
    myPosnEnums = [Position.superscript,Position.subscript];

    noCharStyle = app.activeDoent.characterStyles[0];

    for (var j = 0; myStyles.length>j; j++) {
    try {
    myCharStyle = myDoc.characterStyles.item(myStyles[j]);
    myCharStyle.name;
    } catch (e) {
    myDoc.characterStyles.add({name:myStyles[j],fontStyle:myStyles[j]})
    myCharStyle = myDoc.characterStyles.item(myStyles[j]);
    }
    app.findPreferences = null;
    app.changePreferences = null;
    myDoc.search("", false, false, undefined, {appliedCharacterStyle:noCharStyle,fontStyle:mySty les[j]}, {appliedCharacterStyle:myStyles[j]});
    }

    for (var j = 0; myPosns.length>j; j++) {
    try {
    myCharStyle = myDoc.characterStyles.item(myPosns[j]);
    myCharStyle.name;
    } catch (e) {
    myDoc.characterStyles.add({name:myPosns[j], position:myPosnEnums [j]})
    myCharStyle = myDoc.characterStyles.item(myPosns[j]);
    }
    app.findPreferences = null;
    app.changePreferences = null;
    myDoc.search("", false, false, undefined, {appliedCharacterStyle:noCharStyle,position:myPosn Enums[j]}, {appliedCharacterStyle:myPosns[j]});
    }
    Fred_Goldman@adobeforums.com Guest

  4. #4

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    Dave said move the fourth line, but now myDoc is no longer defined. So insert this line below the third line:

    myDoc = app.activeDoent;

    Teus
    Teus_de_Jong@adobeforums.com Guest

  5. #5

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    No, no. It was the other file that now contains the seven line script you need to use. That's why I had you move them there rather than just delete them.

    Dave
    Dave_Saunders@adobeforums.com Guest

  6. #6

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    Thanks Teus,

    I tried that, but I"m still getting the Bold, Italic, Subscript, and Superscript character styles.

    I don't know too much about scripting, but wouldn't it be the first three lines that are creating these styles?
    Fred_Goldman@adobeforums.com Guest

  7. #7

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    Sorry Dave, I didn't look well enough. I didn't see the last line of the OP: "But I'm looking for something that won't create the bold and italic character styles."

    Teus
    Teus_de_Jong@adobeforums.com Guest

  8. #8

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    Just to be clear. This is the script that does what you want.

    myDoc = app.doents[0];

    myStyles = myDoc.paragraphStyles;
    app.findPreferences = null;
    app.changePreferences = null;
    for (var n = 1; myStyles.length > n; n++){
    myDoc.search("", false, false, undefined, {appliedParagraphStyle:myStyles[n]}, {appliedParagraphStyle:myStyles[n]});
    }

    Dave
    Dave_Saunders@adobeforums.com Guest

  9. #9

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    Fred,

    See Dave's message and my reply: you have to use the other file with seven lines that are moved.

    Teus
    Teus_de_Jong@adobeforums.com Guest

  10. #10

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    That's exactly simultaneous. And Dave's post contains the script.

    Teus
    Teus_de_Jong@adobeforums.com Guest

  11. #11

    Default Re: Mapping Word styles, any way to get ridof the + without Alt clicking each paragraph?

    Thanks Dave and Teus. It works perfectly now.

    Dave you have no idea how much time your scripts have saved me, thanks a bunch.
    Fred_Goldman@adobeforums.com Guest

Similar Threads

  1. Paragraph Styles - Next...
    By Nina_Storm@adobeforums.com in forum Adobe Indesign Macintosh
    Replies: 3
    Last Post: September 27th, 09:25 AM
  2. importing/mapping styles from Word
    By Vicky_Hammerstein@adobeforums.com in forum Adobe Indesign Windows
    Replies: 7
    Last Post: May 25th, 04:06 PM
  3. Paragraph Styles
    By Gabriel_Ayala@adobeforums.com in forum Adobe Indesign Windows
    Replies: 4
    Last Post: August 20th, 08:33 PM
  4. changing type size in paragraph styles and how it effects nested styles
    By Kevin_van_der_Leek@adobeforums.com in forum Adobe Indesign Windows
    Replies: 2
    Last Post: July 28th, 05:58 PM
  5. Paragraph styles!
    By Discover@adobeforums.com in forum Adobe Indesign Windows
    Replies: 1
    Last Post: May 22nd, 04:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139