I'm in dire need of a Script that changes one text to another text. So like say NEWSPAPERS, is Times Roman with a 18 font and Bold, I would like a Javascript that changes the text that has 'NEWSPAPER' of any font type and size to change it to "NEWSPAPERS" with a font of Present LT std with a font size of 18 and bold.
Sample Article would look like this.
NEWSPAPERS
text is below here with correct font and size. once the text is imported into Indesign CS4, this script will change the title of Newspapers to Newspapers but of the required font style, instead of manually having to change the font type and size each time the text is imported to Indesign.
This is a script I've got so far, I'm curious if I'm using the right javascript function's to perform this task.
<script type="text/javascript">
<!--
<!--
<!--
<!--
function fontchange (multiplier)
<---
<--- if font doesn't equal "Present LT std" | Font=black | Size=18 it then goes to the <--- then statement
<---
{If (document.body.style.fonttype = "")
{
<---
<---
<--- If font doesn't Equal Present LT std, then it changes the text to this font style....
<---
<---
then (document.body.style.fonttype = "Present LT std"); (document.body.style.fontSize = (18))
}
}
<---
<---
<---
<---
</script>
Any help would be greatly appreciated with this matter. I will be a script that will be running inside of Indesign CS3. I'm a VB and C++ programmer, and I'm having to Learn Javascript for Indesign, so I know how to program, just dont know the functions of Javascript. I'm hoping this is a fairly simple script to write. Also if anyone knows a good tutorial on how to javascript or more specifically the function commands of javascript, that would be very much appreciated.