• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

With CS3, some things have changed

Participant ,
May 01, 2007 May 01, 2007

Copy link to clipboard

Copied

Let's use this topic to record changes that are likely to affect a working script. As I did in the CS2 comparable topic, I'll add an index here in the topic title when the list is long enough (and I have the time).
TOPICS
Scripting

Views

28.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 08, 2007 Jun 08, 2007

Copy link to clipboard

Copied

Mark,

You would get a better response, I suspect, if you:

1. Posted in a new thread. This one was supposed to be for people converting from CS2 -- there's a similar one for people going from CS to CS2. We don't go back to 1.5, though.

2. Provide some details about your script. Have you tried it on CS3? What happens.

But answer those questions as part of your new topic, please, not here.

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 15, 2007 Jun 15, 2007

Copy link to clipboard

Copied

cornerEffect became cornerOption.

(You can't help but wonder why they make changes like this)

Harbs

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 15, 2007 Jun 15, 2007

Copy link to clipboard

Copied

Perhaps because transparency became effects in the UI?

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 15, 2007 Jun 15, 2007

Copy link to clipboard

Copied

Harbs wrote: "(You can't help but wonder why they make changes like this)"

We can't win. If we leave something named as it was when the UI changes (e.g., "oval" when the UI changed to say "ellipse"), people get upset. If we change something to match the UI (e.g., "effect" to "option"), we upset people.

The UI designers are always changing the names of things--I assume it's to make the interface better or more consistent. We try to match their terms whenever possible.

Thanks,

Ole

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 17, 2007 Jun 17, 2007

Copy link to clipboard

Copied

I'm not *really* complaining. I suppose for new scripters it's nice to
have the terms matching the interface, but I'm trying to write scripts
which work in CS, CS2, and CS3. I really don't care what the exact
terminology of what these things are, but to have them work in all
versions of CS, I have to do a lot of if (app.version...). The less I
have to do this, the happier I am.

I appreciate all the hard work. And you can't make everyone happy all
the time... ;-)

Harbs

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 17, 2007 Jun 17, 2007

Copy link to clipboard

Copied

Hi Harbs,

Does script versioning make your life any easier?

Thanks,

Ole

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 18, 2007 Jun 18, 2007

Copy link to clipboard

Copied

Sometimes. Maybe I should use it more often, but especially with CS3,
there are a lot of situations where versioning doesn't work. (Styles to
name one...)

Harbs

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 13, 2007 Aug 13, 2007

Copy link to clipboard

Copied

Hi to everyone

does anyone know where to find this:
ShadowBlendMode, ShadowBlurRadius, ShadowColor, ShadowMode, ShadowNoise, ShadowOpacity, ShadowSpread, ShadowXOffset, ShadowYOffset in CS3?

I know it is the question but the answer will show changes between CS2 and CS3 - thx

regards

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 13, 2007 Aug 13, 2007

Copy link to clipboard

Copied

They've got snappier names in CS3 but they're harder to find:

Obj.transparencySettings.dropShadowSetting.angle; .blendMode, etc.

I don't see a blurRadius, but maybe it has a different name.

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 14, 2007 Aug 14, 2007

Copy link to clipboard

Copied

> I don't see a blurRadius, but maybe it has a different name.
>
It's called "size"...

Harbs

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 20, 2007 Aug 20, 2007

Copy link to clipboard

Copied

Here are a couple of examples from a script I wrote last week of placing a library asset. The first is placed on (the active page of) a document:

>myAsset.placeAsset(myDoc);

In this second example, the asset is anchored at an insertion point:

>myAsset.placeAsset(myStory.insertionPoints[myIndex]);

In CS2, you had to select an insertionPoint to place as an anchored item.

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 15, 2007 Oct 15, 2007

Copy link to clipboard

Copied

Hello,

I'm working in VB.
Has anyone tried to convert rows from table into header row?
It works fine with footer, but doesn't want to convert a row to header.

Is this a bug? will it soon be fixed?

Thanks
Anne Laure

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 15, 2007 Oct 15, 2007

Copy link to clipboard

Copied

I will be traveling on business beginning Saturday the 13th of October and will have limited access to my email. I will be back in the office on Monday the 22nd of October. For emergencies please contact sales@anodos.gr, or call mob: +30 6977 215264.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 10, 2007 Nov 10, 2007

Copy link to clipboard

Copied

If you use this code to resize a group in CS2:
myGroup = app.selection[0];

myBounds = myGroup.visibleBounds;
myBounds[2] = myBounds[0] + 1;
myGroup.visibleBounds = myBounds;
the strokes in the group are scaled (irrespective of the Transform Content setting). But in CS3, the strokes are simply moved to fit within the same bounds.

I happened upon this because I wanted the CS3 behavior, but I'm writing a script for a client still using CS2. So, I'm going to have to instead move the elements inside the group to get them where I want them to be.

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 14, 2007 Nov 14, 2007

Copy link to clipboard

Copied

Possibly a silly question here but my CS2 scripts don't work in CS3 at all (just upgraded yesterday) even when there are examples of similar scripts in the CS3 Guide.

For example:

myDoc = app.activeDocument;
var myPage = myDoc.pages.item(0);

The above script works in CS2 but it gives the error "undefined is not an object" in CS3. There are examples of similar scripts in the CS3 Guide but they don't work either and give the same error when I cut and paste into ExtendScript Toolkit 2. Does anyone have any advice what I should do?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 14, 2007 Nov 14, 2007

Copy link to clipboard

Copied

You're running from ESTK 2? Did you remember to target InDesign?

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 14, 2007 Nov 14, 2007

Copy link to clipboard

Copied

That was the issue Dave (I thought I had done this but I didn't).

Now I can start debuging these scripts, I hope...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 14, 2007 Nov 14, 2007

Copy link to clipboard

Copied

I'm starting to 'rebuild' some of my scripts to work with CS3 and have run into a few issues. I have solved a couple but I cannot find anything on the following:

for (i = myDataTable.rows.length-1; i >= 0; i--){
elecType = electionType.rows.cells[1].texts[0].contents;
if (elecType == "Postal"){
myTable.rows.cells[0].texts[0].contents = municipalityName.cells.texts[0].contents;
myTable.rows.cells[1].texts[0].contents = electionType.cells.texts[0].contents;
myTable.rows.cells[2].texts[0].contents = wardNumber.cells.texts[0].contents;
myTable.rows.cells[3].texts[0].contents = wardName.cells.texts[0].contents;
myTable.rows.cells[4].texts[0].contents = positions.cells.texts[0].contents;
myTable.rows.cells[5].texts[0].contents = candidates.cells.texts[0].contents;
myTable.rows.cells.everyItem().texts[0].applyStyle(myDoc.paragraphStyles.item("Normal"), false);}

Apart from this taking forever to run, the last line returns the error "is not a function".

Is there a better way to apply a style to certain cells throughout a table based on a corresponding cell value?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 15, 2007 Nov 15, 2007

Copy link to clipboard

Copied

>the last line returns the error "is not a function".

You now have to say applyParagraphStyle (...) or applyCharacterStyle (...).

>Is there a better way to apply a style to certain cells throughout a table ...?

Don't think so. But comparable script I use to apply styles to tables are quick enough for me. Have you tried saving the document on itself (the equivalent of "Save As" in the UI) to delete the undo history? That could speed up any script. Another issue is the size of the table: if it's very large, the script will take some time.

Peter

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 16, 2007 Nov 16, 2007

Copy link to clipboard

Copied

Thanks Peter,

The table is pretty large (about 350 rows by 10 columns). In CS2 the entire script takes about 2 minutes to run which is fine because it's not a script I will be running too often. However in CS3 it takes about 2 minutes to let me know there was an error with the first function. But hopefully when I work out the changes required to update to CS3 it won't take any longer than the CS2 version, plus I now have a Core 2 Duo 2.3ghz instead of the P4 3ghz so I'm hoping this might speed things up a tad.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 19, 2007 Nov 19, 2007

Copy link to clipboard

Copied

Hi guys,

I am having some issues with text overflows within a group. I wrote the following script in CS2 and it worked well but I get an undefined error in CS3.

// Grouped Overset Text
function resizeOverset(){
myStories = myDoc.stories;
for (var j = myStories.length - 1; j >= 0; j--){
while (myStories.overflows == true){
myFrame = myStories.texts[0].parentTextFrames[0];
myTextFrameSize = myFrame.geometricBounds; // error on this line
myTextFrameSize[2]=myTextFrameSize[2]+5;
myFrame.geometricBounds=myTextFrameSize;
}}}

I can get around this by ungrouping but I need to keep the groups.

// Ungrouped Overset Text
function resizeOverset(){
for (i=app.activeDocument.groups.length-1;i>=0;i--){
app.activeDocument.groups.ungroup();
}
myStories = myDoc.stories;
for (var j = myStories.length - 1; j >= 0; j--){
while (myFrames.overflows == true){
var myTextFrame = myFrames;
myTextFrameSize = myTextFrame.geometricBounds;
myTextFrameSize[2]=myTextFrameSize[2]+5;
myTextFrame.geometricBounds=myTextFrameSize;
}}}

Can I resize the geometricBounds while the textFrames are grouped in CS3?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Nov 20, 2007 Nov 20, 2007

Copy link to clipboard

Copied

Hi Brett,
Your 1st function – Grouped Overset Text – works for me in CS3. But I’d do it like this:


var myDoc = app.activeDocument;
resizeOverset();

function resizeOverset(){
myStories = myDoc.stories;
for (var j = myStories.length - 1; j >= 0; j--){
if (myStories.overflows == true){
// fit to content the last text frame in the thread
myLastFrame = myStories.texts[0].parentTextFrames[myStories.texts[0].parentTextFrames.length - 1];
myLastFrame.fit (FitOptions.FRAME_TO_CONTENT);
}
}
}

Kasyan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 20, 2007 Nov 20, 2007

Copy link to clipboard

Copied

Thanks Kaysan, that works a treat and it's fast too.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 17, 2007 Dec 17, 2007

Copy link to clipboard

Copied

flipItem()

In CS3 it's missing the transformingContent parameter. 😞 (Why, oh why is it missing...) I couldn't think of any simple and straightforward way to flip just the frame without the content.

Other than checking for every kind of possible content, and doing a double flip, this function was all I could come up with to replace the functionality:

(Please let me know if I missed something obvious!)
function FlipFrameWithContent(frame,flipDirection,anchorPoint,applyToContent){

if(applyToContent){
frame.flipItem(flipDirection,anchorPoint);
}
else{
var newFrame = frame.duplicate();
newFrame.flipItem(flipDirection,anchorPoint);
for(var i=0;i<frame.paths.length;i++){
frame.paths.entirePath=newFrame.paths.entirePath;
}
newFrame.remove();
}
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 21, 2008 Jan 21, 2008

Copy link to clipboard

Copied

This is one from Ole from a while back. Anyone have a minute to tweak this for CS3?

Many thanks!!

tell application "Adobe InDesign CS3"
set myStyles to every paragraph style of document 1
set find preferences to nothing
set change preferences to nothing
set myStyles to rest of myStyles -- dump "No Style"
repeat with myStyle in myStyles
search document 1 for "" replacing with "" with find attributes {applied paragraph style:myStyle} with change attributes {applied paragraph style:myStyle}
end repeat
end tell

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines