[JS  CS3] Apply Italics with scripting

There's a keyboard shortcut called "Apply Italics", which by default is [cmd]+[shift]+[i] on Mac, and  [ctrl]+[shift]+[i] on Windows. I use it often because it will change text to the correct italic style. For instance text with the style "85 Heavy" will change to "86 Heavy Italic" or "Semibold Display" to "Semibold Display Italic".
Is there any way to access "Apply Italics" with scripting? The action is not available in any menu as far as I know.

I made this script which will change all text with the character style "I" into proper italics, and creates corresponding character styles. "I" is just a character style with no properties. It gets applied when I import content into InDesign.
I will end up with styles called "I 37 Thin Condensed Oblique", "I Italic Display" and so on according to the various fonts.
function applyItalic(){ // Finds all text with Character Style "I" applied in the current document and changes it to proper italic character styles
     var mySelection = app.selection;
     var myDoc = app.activeDocument;
     var myRanges = myDoc.stories.everyItem().textStyleRanges.everyItem().getElements(); // gets every textStyleRange in the document;
     var italicStyle = myDoc.characterStyles.itemByName ("I"); // this character styles has no attributes;
     if (italicStyle == null){
          return;
     var myRange;
     var myFont;
     var newStyle;
     var newStyleName;
     var n;
     for (n=0; n<myRanges.length; n++){
          myRange = myRanges[n];
          if (myRange.appliedCharacterStyle==italicStyle){
               app.select(myRange);
               app.menuActions.itemByID(119611).invoke(); // apply italics - same as [cmd]+[shift]+[i]
               myFont=myRange.appliedFont;
               newStyleName="I "+myFont.fontStyleName;
               newStyle=myDoc.characterStyles.itemByName(newStyleName); // if the style is created
               if (newStyle==null){
                    newStyle=myDoc.characterStyles.add({name: newStyleName, fontStyle: myFont.fontStyleName}); // if the style does not exist yet
               myRange.appliedCharacterStyle=newStyle;
     app.select(mySelection); // restores the original selection
applyItalic();

Similar Messages

  • Can i keep using bridge cs3 in combination with photoshop cs5

    can i keep using bridge cs3 in combination with photoshop cs5

    I have a question sort of relevant to this discussion. Had my 8800GT start to fail on me in my MacPro1,1 - in desperation I disassembled the card, cleaned it, applied fresh thermal compound/padding, and stuck it back in. To my amazement the card actually began working again! Before failing a few days later ; ;.
    I ordered a replacement 8800GT on ebay for a considerably low cost, but before it arrived my computer began behaving normally again. From what I'm understanding from this thread, there is absolutely no benefit to installing both cards in my computer at the same time? If that's the case, I'm going to tuck the backup card away and keep riding my self-repaired card until it crashes again.

  • Problems applying preboot imaging script bundle w/ 11.3.2

    Hi all,
    Just wondering if its just me with these issues.
    I had our preboot imaging script bundle assigned to the Workstation folder within the ZCC, but since the update to 11.3.2 when attempting to apply the imaging script bundle to a device within the ZCC it throws an error saying that no imaging script bundle is assigned to the device. The only way to get around this issue has been for me to assign the preboot imaging script bundle to each device within our zone, not the folders they exist within.
    Another issue I've had is if I select more than one device within the ZCC the action option "apply assigned imaging bundle" is greyed out. If I only select one device I am able to use that option again.
    Can anyone else confirm if they're experiencing the same issues?
    We're running 3x SLES 11 primaries running 11.3.2, all with the imaging role (our imaging script load balances between the three).
    I've tried accessing the ZCC with Internet Explorer, Firefox and Chrome and they all experience the same issue above.
    Regards,
    Matt

    Originally Posted by Thomas Degenhardt
    Am 17.12.2014 um 02:16 schrieb xvastx:
    >
    > Hi all,
    >
    > Just wondering if its just me with these issues.
    >
    Hello Matt,
    we are having the same issues. Did you contact Novell and opened a SR?
    Regards,
    Thomas
    Hey Thomas,
    We're on an educational licence so, unfortunately, we don't have any SRs to play with. Hopefully Anders has sent the issue trough to Novell.
    Regards,
    Matt

  • Is it ok to apply patch with invalid Objects?--Urgent

    hello,
    DB: 10.1.0.3.0
    Patch: P4751926
    OS: Linux
    I have seven invlaid objects.
    Is it ok to apply patch with invalid Objects?
    sys.LEAF_CATEGORY_TYP------------------------------------TYPE BODY
    sys.CUSTOMER_TYP----------------------------------------------TYPE
    sys.CATALOG_TYP-------------------------------------------------TYPE BODY
    sys.COMPOSITE_CATEGORY_TYP-------------------------TYPE BODY
    sys.DBMS_STATS---------------------------------------------------PACKAGE BODY
    sys.DBMS_STATS_INTERNAL--------------------------------- PACKAGE BODY
    PUBLIC.DBMS_XDBUTIL_INT------------------------------------SYNONYM
    DN

    did u try to recompile the invalid objects with the utlrp.sql script? (the script is under, <oracle_home>/rdbms/admin
    your dbms_stats is invalid, and that package is needed for getting the statistics so better to have it valid than invalid.

  • Modify an object with scripting

    I know I can change the position, but can I change the width of a ListBox with scripting?

    1LMR wrote:
    Rolf,
    OK, there is a Size:Width in the standard Property Node, but I specified "Scripting".  With the green GObj Property Node there is no Size.  It has only Bounds Read Only.
    Regards,
    1LMR
    Scripting is simply an extension to the standard VI Server interface, with no clear boundery other than what NI thinks is not everyday use in properties and methods. The option to disable scripting is mainly to make the object hierarchy and property and method menus less crowded and intimidating to a starting LabVIEW user.
    As such there are properties that apply to any object, and others that apply to a certain group of objects and some that apply only to a specific type. There is no way to set the size of an object on the top level object hierarchy since some objects do not support changing their size at all. So the objects that allow to change their size have such properties in a more class specific level. This means you have to cast generic object refnum into a more specific refnum in order to be able to get at those properties.And you can only cast a refnum into a more specific refnum if the object type actually matches.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Mac OS Localization with scripts

    Hi all,
    Since 10.5 (and now 10.6), we try to apply localization scripts when we restore our ghost.
    We have 4 locations to provide : France, UK, Netherlands and Belgium. Each have a different localization formats.
    Our Ghost is a Mac OS 10.6.5 US located, and contain only one local admin (ladmin) session.
    Localization customizing is done with scripts that contain some instructions using "languagesetup", "systemsetup" and "defaults write" on some files.
    Files changing using "defaults write" are :
    /Users/ladmin/Library/Preferences/.GlobalPreferences (to define admin's region, currency)
    /Users/ladmin/Library/Preferences/ByHost/com.apple.HIToolbox (to define admin's input keyboard list)
    /Library/Preferences/com.apple.HIToolbox (to define loginwindow's input keyboard list)
    /var/tmp/com.apple.HIToolbox.loginwindow (to define loginwindow's input keyboard list)
    /System/Library/User Template/$Language/Library/Preferences/.GlobalPreferences (to define template's region, currency)
    /System/Library/User Template/$Language/Library/Preferences/ByHost/com.apple.HIToolbox (to define template's input keyboard list)
    If local account's localizing, loginwindow keyboard input list, language setup work well, the .GlobalPreferences in the user template is ignored.
    For exemple, for a french version (region : France, currency : Euro, Measurement units : Metric), when we login as a new user, we have :
    Region : US (french)
    Currency : US Dollar
    Measurement units : Metric
    Is there a link with the original language of the ghost ?
    So, is there a deeper command of "languagesetup" to change System language ?
    And sure, how to do that correctly ?

    Are you using a WACOM tablet?
    This is known behavior with tablets. It sucks but WACOM doesn't ever seem to fix it. Only solution I know is to disconnect the tablet.

  • How to create a new Oracle OSB project automaticaly with script without IDE

    Hello,
    I want to create automatically an "Oracle service bus project" and an "Oracle service bus configuration project" with scripts (ANT or Maven or ...) without using IDE, without using workshop or Eclipse. I want to create automatically (ANT or Maven) just a skeleton of an OSB project witch i can use after in workshop.
    I want to create 1 "Oracle service bus configuration project" with many "Oracle service bus project" automatically (ANT or Maven or scripts) witch i can use after in workshop. How to create a new Oracle OSB project automaticaly with script without IDE ? How can i do this ?
    I'm using Oracle service bus 10.3.1
    Thank you for your help.

    Thank you for your response,
    I do not want to just create the services (proxy services and business services) but I want to create a template for 40 OSB project with the same scripts ANT/Maven.
    Template="Oracle service bus configuration project" + "Oracle service bus project" + services of 40 OSB projects
    The goal is that I have more than 40 projects to create and just the name of the projects that changes (when I say the name of the project ie the name of the OSB project, the name of proxy services and the name of business services ).
    So I want to give my script (ANT/Maven) the name of 40 OSB project and the script must generate the skeleton of the 40 projects at once time and after generation of skeleton of the 40 project, I will import them in the workshop to add manually mapping and routing and other things that differs from one project to another.
    So i want to generate automatically a skeletons of 40 OSB projects using a script (ANT / Maven) and I give to the script juste the names of the 40 projects.
    I want to create a "Oracle service bus configuration project" and "Oracle service bus project" automatically of 40 OSB projects (ANT or Maven or scripts) witch i can use after in workshop.
    I want to create one 'template' of all 40 projects in the same time, with the same directory structure (Transforlation, Business services, proxy services, WSDL .....) and all 40 project have the same transport, just the names of projects and services witch changes and i can give to the script all names of projects and services and i can give also all WSDL.
    Regards,
    Tarik

  • If firefox automatically updates my computer past 3.6 I'm inundated with Script Freezes..how do I stop new automatic updates?

    Everytime I'm automatically updated past 3.6 my computer is inundated with Script Freezes..especially on the email page of gmail.
    This has happened many many times. As far as I can determine these Script Freezes (Says: A script is attempting to write on this page.."Continue"..Stop Script etc) are coming from Internet Explorer (I'm not sure of this) and it's tricky to delete any elements of Internet Explorer. But at any rate my computer freezes up until the Script problem is settled..I check the don't ask me again block..but it does no good.
    My real question is: Since things work fine in 3.6...how can I avoid any automatic updates?
    Also, why isn't there a Timer Window (or a timer bar)for Firefox?...sometimes I have to wait 5 minutes for it to load! If there was a timer at least I'd know that something is happening and I'd be willing to wait. When it does take forever to load..it seems to help if I delete all Prefetch and temporary files.
    Is there a safe way of turning off Internet Explorer temporarily?
    Thanks for your help
    Matthew
    [email protected]

    I tried this today, and it is working now:
    Click Firefox > Options > Options > Advanced ... then Uncheck the option "Use hardware acceleration when available"

  • Paragraph Alignment question - is it possible with scripting?

    Hello. I am working on a business card template that has a paragraph alignment problem. I have asked in other forums if it was possible, they pointed out that it might be, with scripting.
    I need to know if it is, so I can dig further.
    Here is the problem: I have a name and title on seperate line that need to be aligned to the right margin (the longest line touches the right margin) but centered above or below themselves. The text box is set to receive a large amount of characters. This is an automated system using InDesign Server so no manual adjustments are being made once the information has been submitted.
    Is this possible?

    Again, I don't know anything about ID Server, but you can try this. Label the text frame 'card' (select the frame, go to Window > Automation > Script label and enter a 'card' -- without the quotes).
    try
       tf = app.activeDocument.textFrames.item ('card');
       p0 = tf.paragraphs[0];
       p1 = tf.paragraphs[1];
       p0.justification = Justification.rightAlign;
       p1.justification = Justification.rightAlign;
       p0left = p0.insertionPoints[0].horizontalOffset;
       p1left = p1.insertionPoints[0].horizontalOffset;
       if (p1left > p0left)
          p1.rightIndent = (p1left-p0left)/2
       else
          p0.rightIndent = (p0left-p1left)/2;
    catch(_){}
    This one doesn't rely on a selection.
    Peter

  • EVENTS WITH SCRIPTS not visible

    Hi,
    I am not able to see the events with scripts in the SHOW drop down.
    How can I get the above to have the calculations done?
    the version of the designer is 8.0
    Regards

    Hi,
    When it displays in the “default Calendar view” ,it shows "Event Permissions" option under EVENTS ribbon, this option can set permissions for a single
    event. Click
    ” List Settings “
    option under CANLENDAR ribbon, the "Permissions for this list” option can set permissions for the entire calendar.
     When it displays in the "All Events" view, it shows "Shared With" option both 
    in the ITEMS and LIST ribbon. This option under the ITEMS can set permissions for a single event. This option under the LIST can set permissions for the entire calendar.
    Best regards,
    Wendy 
    Wendy Li
    TechNet Community Support

  • Cursor postion with scripting in Adobe LiveCycle ES

    Hi,
    I have a textfield that populates editable text when we click pdf preview. when I tab the cursor moves to the end of the pharagraph. we are using some screen readers that reads the text. Our requirement is to bring the cursor at the begining of the text when tabbed.
    Is it possibe to bring the cursor at the begining of text with scripting.
    please post the steps if possible.
    Your help on this would be highly appriciated.
    Thanks,
    Ramesh Punugubati.

    Hello Jasmin
    The "Results" variable need to declared out of the try and catch block, otherwise it won't be recognized when it comes to "close" at the end.
    Here is a modified version of your script.
    Greetings,
    Yasser
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import javax.sql.DataSource;
    import javax.naming.InitialContext;
    import java.sql.CallableStatement;
    CallableStatement proc_stmt = null;
    InitialContext context = new InitialContext();
    Connection connection = ((DataSource)context.lookup("java:/IDP_DS")).getConnection();
    proc_stmt = connection.prepareCall("{ call CalculateTotal() }");
    ResultSet results;
    try
    results = proc_stmt.executeQuery();
    if (results.next())
      patExecContext.setProcessDataStringValue("/process_data/@Total",results.getString(1));
    catch(Exception ex)
         ex.printStackTrace();
    results.close();
    proc_stmt.close();
    connection.close();

  • Reproducable Error with script SYS.I_PLSCOPE_SIG_IDENTIFIER$

    Hi Oracle,
    I get an error when running attached script:
    The error message is:
    ORA-00603: ORACLE server session terminated by fatal error
    ORA-00600: internal error code, arguments: [kqlidchg1], [], [], [], [], [], [], [], [], [], [], []
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00001: unique constraint (SYS.I_PLSCOPE_SIG_IDENTIFIER$) violated
    00603. 00000 - "ORACLE server session terminated by fatal error"
    *Cause:    An ORACLE server session is in an unrecoverable state.
    *Action:   Login to ORACLE again so a new server session will be created
    DROP SEQUENCE T_TEAM_ID;
    DROP SEQUENCE T_COMPANY_ID;
    DROP TABLE t_company CASCADE CONSTRAINTS
    DROP TABLE t_team CASCADE CONSTRAINTS
    CREATE TABLE t_company
    id INTEGER NOT NULL ,
    name VARCHAR2 (20) NOT NULL
    ALTER TABLE t_company
    ADD CONSTRAINT PK_company PRIMARY KEY ( id ) ;
    CREATE TABLE t_team
    id INTEGER NOT NULL ,
    company_id INTEGER NOT NULL ,
    name VARCHAR2 (20) NOT NULL
    ALTER TABLE t_team
    ADD CONSTRAINT PK_team PRIMARY KEY ( id ) ;
    ALTER TABLE t_team
    ADD CONSTRAINT FK_t_team_t_company FOREIGN KEY
    company_id
    REFERENCES t_company
    id
    CREATE SEQUENCE T_COMPANY_ID
    NOCACHE
    ORDER ;
    CREATE SEQUENCE T_TEAM_ID
    NOCACHE
    ORDER ;
    CREATE OR REPLACE TRIGGER t_team_BI
    BEFORE INSERT ON t_team
    FOR EACH ROW
    WHEN (NEW.id IS NULL)
    BEGIN
    SELECT T_TEAM_ID.NEXTVAL INTO :NEW.id FROM DUAL;
    END;
    CREATE OR REPLACE TRIGGER t_company_BI
    BEFORE INSERT ON t_company
    FOR EACH ROW
    WHEN (NEW.id IS NULL)
    BEGIN
    SELECT T_COMPANY_ID.NEXTVAL INTO :NEW.id FROM DUAL;
    END;
    The error is thrown for the CREATE OR REPLACE TRIGGER and also comes up when creating the rest 1st, logging of and logging in again.
    As it seems to be a serious error (I'd never expect it to show) and I don't now how to solve it, I wrote you this bug report.
    I'm on Win7 Pro and using SQL Developer 3.0.04. Oracle version installed is:
    SELECT * FROM V$VERSION
    where banner like 'Oracle%';
    BANNER
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    Any advise or idea how to solve the error?
    Thank you,
    Blama

    Error with script SYS.<...>Using sysdba connections for schemas is strongly discouraged.
    Creating tables in the system tablespace that have no relation to the sys and system schemas brings its own set of admin headaches, sysdba should only be used to shutdown or startup an instance.
    Or if there is a specific SYS object that needs to have permissions granted that cannot be done via a user with the DBA role privilege (i.e. SYSTEM), that should be the only time a sysdba connection is needed.
    Also, beginning with 11g the pl/sql for setting a column with a sequence value can be done directly, no 'select ... into ... from dual;' needed.
    begin
      :new.<column> := <sequence>.nextval;
    end [<trigger name>];

  • Find a text frame on the page with script label

    hello to all
    I need to create a script to
    find a text frame on the page with script label "xxx"
    and read its contents into a variable.
    The content of the text frame is a number.
    thanks

    Hi Roberto,
    Welcome to the forum,
    This will find the labeled textFrame on the active page.
    var myLabel = "Foo", // change to label
          myPage = app.properties.activeWindow && app.activeWindow.activePage,
          myTextFrames = myPage.textFrames.everyItem().getElements().slice(0),
          l = myTextFrames.length,
          myVariable
    while (l--) {
        if (myTextFrames[l].label != myLabel) continue;
        myVariable = myTextFrames[l].contents;
        break; // presuming there's only one "Foo" labeled frame on the page
        // Otherwise you'll nead an array
    alert(myVariable)
    Trevor

  • If Are all the pictures can be enlarged to 160% with script in indesign cs6?

    a book is composing ,but the gest feel the picture is too small,all want to  enlarged to 160%,
    but there is Thousands pictrure, It is could be Achieve with script?
    just like thist

    @喜狼_edny – if you are using my script snippet, there is a undo in one go for the whole action.
    Furthermore if used with images anchored, make sure that the anchor settings are appropriate before.
    Before:
    (The container below is locked and will not scale)
    Anchor settings with wrong anchor reference point settings (German UI):
    After scaling (new position according to the anchor settings):
    Second try with different anchor settings:
    After running the script:
    Note: images locked or images on locked layers will not be scaled.
    This could be expanded. Eg. for images positioned on not visible layers.
    Images on the pasteboard etc.pp.…
    Uwe

  • Cs3 problem printing with mavericks

    cs3 problem printing with mavericks

    Hello @arcticbear38,
    Welcome to the HP Forums!
    I understand you're receiving a small portion on the left hand side of a document missing on both printers. I will do my best to assist you! Does this happen when you print from one program or many program(s)?
    Both of these printers are not indicating low on ink? I would recommend resetting the printing system on your computer by following this Apple document here. I will be looking forward to hearing from you. Have a great night!
    I worked on behalf of HP.

Maybe you are looking for