home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Internet Web Designer 86
/
PIWD86.iso
/
pc
/
contents
/
illustration
/
software
/
Installer
/
data1.cab
/
Program_Files
/
Presets
/
Scripts
/
ApplyStyleToTextSelection.js
< prev
next >
Wrap
Text File
|
2001-11-29
|
864b
|
45 lines
// Apply a style to selected text.
ApplyStyle();
function ApplyStyle()
{
selectedItems = selection;
// check to make sure something is selected.
if (selectedItems.length == 0)
{
alert("Nothing is selected");
return;
}
endIndex = selectedItems.length;
for (index = 0; index < endIndex; index++)
{
pageObject = selectedItems[index];
pageItemType = pageObject.typename;
if (pageItemType == "TextArtItem")
{
theTextRange = pageObject.textRange();
theTextRange.size = 48;
theArtStyles = activeDocument.artStyles;
if (activeDocument.documentColorSpace == DocumentColorSpace.CMYK)
{
useArtStyle = theArtStyles["Caution Tape"];
useArtStyle.applyTo(pageObject);
}
else
{
useArtStyle = theArtStyles["Blue Goo"];
useArtStyle.applyTo(pageObject);
}
}
}
}