-
1. Re: Adressing an object by it's id
John Hawkinson Apr 25, 2012 7:46 AM (in response to PrntScr)It this JavaScript?
You should use app.activeDocument.textFrames.itemByID(3771).
Where did you find this .item.id() syntax?
-
2. Re: Adressing an object by it's id
PrntScr Apr 25, 2012 7:53 AM (in response to John Hawkinson)Hi John, and thanks
Consider me an absolute noob. Yes this is JavaScript. I found fragments within another script which I thought would work, but didn't. With your correction, and some further research it now looks like this:
var textblock = app.activeDocument.textFrames.itemByID(3771);
textblock .move( [0, 4] );
but still doesn't move the textframe.
-
3. Re: Adressing an object by it's id
John Hawkinson Apr 25, 2012 7:58 AM (in response to PrntScr)Your answer to "where?" is "somewhere" but not-gonna-say? I see.
Are you sure your ID is correct? What if you use
var textblock = app.activeDocument.textFrames[0];
? Are your units set reasonably so that you would see a [0,4] move?
Do you get an error?
-
4. Re: Adressing an object by it's id
PrntScr Apr 26, 2012 7:35 AM (in response to John Hawkinson)Didn't think it was relevant, but here you go (an instance of "textFrame.id", from InDesignCS5_ScriptingGuide_JS.pdf)
http://dl.dropbox.com/u/5420164/Screen%20shot%202012-04-26%20at%2016.11.00.pngThe id was wrong, just like you said.
This line now works:
app.activeDocument.textFrames.itemByID(3768).move( [0, 4] );
-



