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

With CS4, some things have changed

Participant ,
Oct 18, 2008 Oct 18, 2008
This topic is not about new features but changes, primarily in the object model, that will affect scripts that run perfectly well under CS3.

Bear in mind that as before, you can create a folder for previous version scripts and run from there, in which case the previous object model is employed -- indeed, CS4 allows you to do this for scripts all the way back to CS scripts. The Object Model Viewer in ESTK, once you've initialized it by opening it once and choosing the InDesign CS4 Object Model, allows you to see all four supported object models.
TOPICS
Scripting
16.8K
Translate
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 ,
Oct 18, 2008 Oct 18, 2008
The TextWrapPreferences property previously known as textWrapType is now called textWrapMode.

This affected my WrapNudger. To see how I handled the change so WrapNudger would work with both CS3 and CS4, see this topic in my blog.

Dave
Translate
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 ,
May 15, 2009 May 15, 2009

Hi,

it looks like that with 6.0.2 Adobe changed the textWrapPreferences property textWrapMode back to textWrapType as it was in CS3.

Or am I totally confused now ?

Stefan

Translate
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
Guest
May 15, 2009 May 15, 2009

Hi Stefan,

It didn't change. Is it possible that you're looking at/using the CS3 version of the scripting DOM?

Thanks,

Ole

Translate
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 ,
May 18, 2009 May 18, 2009

Hi Olav,
yes I was confused scripting for two versions.
With this it works for both versions now:
var APP_INT_VERSION = parseInt(app.version);
if (APP_INT_VERSION == 6) {
     myCurrentFrame.textWrapPreferences.textWrapMode = TextWrapModes.BOUNDING_BOX_TEXT_WRAP;
} else {
     myCurrentFrame.textWrapPreferences.textWrapType = TextWrapTypes.BOUNDING_BOX_TEXT_WRAP;
}
Thanks Stefan

Translate
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 ,
May 18, 2009 May 18, 2009

Stefen,

Just a heads up...

Since they're probably not changing the TextWrapModes back, you'd be

better off with:

if (APP_INT_VERSION >= 6) {...

Harbs

Translate
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
Advocate ,
Oct 18, 2008 Oct 18, 2008
One thing to watch for, which isn't really a scripting change but may well<br />affect scripts, is the change to the way rulers work when the document<br />origin is set to spine.<br /><br />In CS4, the rulers measure out from the spine, with values to the left<br />negative and values to the right positive. This means, for example, items on<br />page 2 of a typical facing pages document will have bounds such that x2 is<br />less than x1 if the origin is set to spine.<br /><br />It might be prudent to start setting the origin to a known value at the<br />beginning of some scripts, to avoid surprises.<br /><br />Ironically, the values returned in CS4 match the way they were returned when<br />scripting InDesign (but not in the UI) many versions ago.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au>
Translate
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 ,
Oct 19, 2008 Oct 19, 2008
Hi Dave,

Thankfully, this thread should be much much shorter than the CS3 one.
There have been very few changes that will effect existing scripts. How
about starting another thread for new features? There's a number of new
features I'm quite happy about! (Like UndoMode, isValid, ScriptUI
enhancements, etc.) I think they're worth discussing.

--
Harbs
http://www.in-tools.com
Translate
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 ,
Oct 19, 2008 Oct 19, 2008
At http://www.kahrel.plus.com/indesign/pdf_dictionaries.html is a list with all properties, methods, and enumerations of InDesign's CS4 object model. New items are highlighted, so that it is easy to see what has been added since CS3.

Peter
Translate
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 ,
Oct 19, 2008 Oct 19, 2008
Harbs,

You're welcome to start such a topic. I'll make sure it stays at or near the top.

Dave
Translate
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 ,
Oct 25, 2008 Oct 25, 2008
In CS3, the object class for a page imported from another InDesign document was:

ImportedPage

but the name of its collection class was:

IndesignPageItems

and the corresponding properties followed this naming convention. Thus, for example:

myRectangle.indesignPageItems

In CS4, this inconsistency has been fixed. The collection is now properly named:

ImportedPages

and the corresponding properties are also renamed:

myRectangle.importedPages

Dave
Translate
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 ,
Oct 29, 2008 Oct 29, 2008
textWrapType(s) is now textWrapMode(s)

So instead of this:
>myObj.textWrapPreferences.textWrapType = TextWrapTypes.jumpObjectTextWrap

You need this:
>myObj.textWrapPreferences.textWrapMode = TextWrapModes.jumpObjectTextWrap

Seems a rather awkward thing to change.

Peter
Translate
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 ,
Oct 29, 2008 Oct 29, 2008
Hi Peter,

I'm pretty certain that that change has to do with a language-specific problem--probably an AppleScript term conflict.

Thanks,

Ole
Translate
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 ,
Oct 29, 2008 Oct 29, 2008
Ole,

Well, I ran a CS3 script in CS4 that contained a line with ...textWrapType = TextWrapTypes..., which errored out on that line. Looked up "textWrapType" in the OMV but it wasn't listed there, and found textWrapMode instead. After changing that, the script ran fine in CS4.

Peter
Translate
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 ,
Oct 29, 2008 Oct 29, 2008
Nobody reads message 1.

Dave
Translate
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 ,
Oct 29, 2008 Oct 29, 2008
>Nobody reads message 1.

Groan... Sorry about that! I read it at the time and forgot about it, too.

Peter
Translate
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 02, 2008 Nov 02, 2008
The Text.appliedNestedStyle property has been changed to:

Text.appliedNestedStyles

because a character can now have more than one character style applied by nesting.

Dave
Translate
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 ,
Feb 06, 2009 Feb 06, 2009
I guess not too many scripts will have problems with this change, but you never know:

You have a document with 2 facing pages, and they are not allowed to shuffle like this [1-2].

Now you use in VB the command:

oDocument.Spreads.Add

In all previous CS Versions, InDesign created a new Spread consisting of 2 facing pages 3-4. 3 is a left page and 4 a right page. As I wanted

Now in CS4 you get as well 2 new pages, but they are not facing. Page 3 is a right page and page 4 is a single left page.

So my solution just adding 2 new spreads, take the pages you want to keep toghether disable shuffling and delete the unused pages.

Christoph
Translate
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 ,
Mar 04, 2009 Mar 04, 2009
I don't know if this is applicable here but can anyone throw some light on the MS Word import.

We have it working fine on Server CS3 just fine but not on Server CS4. It only imports text formatting, not tables, images, etc. And if it comes across, say an image first it fails to import anything else.

I can't find any documentation/threads on this as yet. So any pointers greatly appreciated.

ta!
Translate
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 ,
Mar 04, 2009 Mar 04, 2009
Hi Ian,

What that probably means is that there are differences in the Word/RTF import preferences between the two installations--have you compared those?

Thanks,

Ole
Translate
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 ,
Mar 04, 2009 Mar 04, 2009
If I import a doc like this how do I set preferences?

myTextFrame.Place "test.doc"

----
WordRTFImportPreference
preserveGraphics
etc

Seems everything was on by default in CS3 but tables and graphics need prefs specifying in CS4 (I can get text formatting)

any pointers greatly appreciated

many thanks

newb
Translate
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 ,
Mar 04, 2009 Mar 04, 2009
Hi Ian,

Something like this:

Rem Given an instance of InDesign "myInDesign"...

myInDesign.WordRTFImportPreferences.PreserveGraphics = True
myInDesign.WordRTFImportPreferences.ConvertTablesTo = idUnformattedTable
Rem ...set other import preferences...
Rem Now do your place operation

Thanks,

Ole
Translate
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 ,
Mar 04, 2009 Mar 04, 2009
It wasn't that after all. But another 'slight' difference causing stuff not to show up. Seems measurements need to be explicit ie: in CS3 24 was 24mm in CS4 24mm is 24mm!

also idUnformattedTable needs a value in VB I presume
UNFORMATTED_TABLE
UNFORMATTED_TABBED_TEXT
are they

I'll run a series of benchmarks at the weekend and post results.

The differences between CS3 and CS4 post idea is an excellent idea by the way DS
Translate
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 ,
Mar 18, 2009 Mar 18, 2009
In postscipt file export pdf, it throw a error like "PAGEMARKS DEFINITION FILE ERROR" i need soultion for this.
regards,
kan
Translate
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 ,
Mar 18, 2009 Mar 18, 2009
When you say, "it," what exactly are you talking about? And which scripting language did you use?

Dave
Translate
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