Article View: adobe.scripting.indesign
Article #522Re: auto font swap
From: Fred_Goldman
Date: Thu, 12 Mar 2009 20:17
Date: Thu, 12 Mar 2009 20:17
23 lines
1493 bytes
1493 bytes
Hmm, why didn't Harbs' script poster work?
myFolder = Folder (["~/Documents/InDesign Documents"])
myFiles = myFolder.getFiles()
for(var i = 0; i < myFiles.length; i++){
var myDoc = app.open(myFiles[i])
for(var j= 1; myDoc.characterStyles.length>j; j++){
if(myDoc.characterStyles[j].appliedFont == "Adobe Garamond Pro" && myDoc.characterStyles[j].fontStyle == "Regular"){
myDoc.characterStyles[j].appliedFont = "Adobe Whatever Pro"
myDoc.characterStyles[j].fontStyle = "Regular"
}else{
if(myDoc.characterStyles[j].appliedFont == "Adobe Garamond Pro" && myDoc.characterStyles[j].fontStyle == "Bold"){
myDoc.characterStyles[j].appliedFont = "Adobe Whatever Pro"
myDoc.characterStyles[j].fontStyle = "Bold"
}
}
}
myDoc.close(SaveOptions.yes,myDoc.fullName)
}
Technical Details
Message-ID:
<59b82ebd.3@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossingReferences:
<59b82ebd.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,4bc1edf4574cbc50 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Fred_Goldman@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: auto font swap Message-ID: <59b82ebd.3@webcrossing.la2eafNXanI> Date: Thu, 12 Mar 2009 13:17:51 -0700 References: <59b82ebd.-1@webcrossing.la2eafNXanI> Lines: 24 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Original-Lines: 28