Copy link to clipboard
Copied
I'm trying my first whoop at a script and I am in dire need of some help. I've downloaded all kinds of example, however most are too elaborate.
Here's what I'm trying to do:
A Find/Change, then Find Format (Basic Character Formats; Font Style "Italic")
Then
Change Format (Character Style; "my style")
I've tried to create this in Applescript and in ExtendScriptToolkit.
Yesterday I read Adobes Script intro PDF.... Now, I don't know if I'm more confused or understanding what's going on.
Here's my attempt—
{
cstyle = app.activeDocument.characterStyles.add({name:simple_italic});
if (italic) cstyle.fontStyle = app.findTextPreferences.fontStyle;
}
}
app.changeTextPreferences.appliedCharacterStyle = simple_italic;
app.activeDocument.selection[0].parent.changeText (false);
}
Is this even close?
Thanks, T—
I found my own answer... Thanks guys!
{
if (StyleName == "")
{
// Make up a name
if (bold)
StyleName = "simple_bold";
if (italic)
{
if (bold)
StyleName = "simple_bold_italic";
else
StyleName = "simple_italic";
}
Copy link to clipboard
Copied
Actually, Jongware's PrepText works!
However, it adds Character Styles....
Which I really don't want. I've tried to edit the script using my (simple_bold, simple_italic etc.) Character Styles, no luck.
This is Jongware's script:
Copy link to clipboard
Copied
I found my own answer... Thanks guys!
{
if (StyleName == "")
{
// Make up a name
if (bold)
StyleName = "simple_bold";
if (italic)
{
if (bold)
StyleName = "simple_bold_italic";
else
StyleName = "simple_italic";
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now