Article View: adobe.scripting.indesign
Article #8168Re: [IDCS2][JS] emulate the function+shift+i shortcut
From: Peter_Kahrel
Date: Mon, 06 Nov 2006 10:14
Date: Mon, 06 Nov 2006 10:14
23 lines
1149 bytes
1149 bytes
Try this:
app.selection[0].fontStyle = getfontstyle()
function getfontstyle()
{
var myFont = app.selection[0].appliedFont.fontFamily
if( app.fonts.item( myFont+'\tItalic' ).index > 0 )
return 'Italic';
else if( app.fonts.item( myFont+'\tOblique' ).index > 0 )
return 'Oblique';
else
exit();
}
I could not find any font with an oblique style, but I use something comparable to select semibold if the font has it, otherwise bold, so this will probably work.
Peter
Technical Details
Message-ID:
<3bc230d6.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.musoftware.de!news.albasani.net!news.isoc.lu!webcrossingReferences:
<3bc230d6.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,608fb6aca6676e0e,start X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Peter_Kahrel@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.musoftware.de!news.albasani.net!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: [IDCS2][JS] emulate the function+shift+i shortcut Message-ID: <3bc230d6.0@webcrossing.la2eafNXanI> Date: Mon, 6 Nov 2006 02:14:36 -0800 References: <3bc230d6.-1@webcrossing.la2eafNXanI> Lines: 21 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit