Hi All,
I am new to indesign javascript and trying to move the text frame in top of the page by using the below move command.
myGraphics[j].parent.move[myY1,myX1];
But unfortunately the frame is remaining in the same position and this is i need to achieve in Image placing of float tool.
I am trying to move the text frame in the top of the page since need to place the images in top and bottom of the page.
This is bottleneck case and last 3days struggling lot to get this scenario.
Any help is greatly appreciated.
Thank you in advance.
Regards,
Sathya Rani M
I think you are speaking about the same case discuused in the below forum link, is that you want. Looks like you both are working on the same task.
http://forums.adobe.com/message/4450216#4450216
---------
Green4ever
How is this different from your previous question in http://forums.adobe.com/message/4450216#4450216?
The code in there works. If it does not for you, YOU HAVE TO TELL US WHY NOT.
(Edit) "Bcs it doesnt do exactly what i want" is not a good answer.
Hi Green4Ever/Jong,
Thank you for writing to me and the question is same what ever posted in the mentioned link is same and more over i didnt say that is different from my case. I too tried with the same logic which is stated below.
for(i=0;i<myPages.length;i++)
{
var myGraphics=myPages[i].allGraphics;
for(j=0;j<myGraphics.length;j++)
{
if(myPages[i].side == PageSideOptions.leftHand)
{
var myX2 = myPages[i].marginPreferences.left;
var myX1 = myPages[i].marginPreferences.right;
}
else
{
var myX1 = myPages[i].marginPreferences.left;
var myX2 = myPages[i].marginPreferences.right;
}
var myY1 = myPages[i].marginPreferences.top;
var myX2 = myPageWidth - myX2;
var myImageheight=myGraphics[j].parent.geometricBounds[2]-myGraphics[j].p arent.geometricBounds[0];
var myY2=myY1+myImageheight;
myGraphics[j].parent.geometricBounds=[myY1,myX1,myY2,myX2];
myGraphics[j].parent.move[myY1,myX1];
myGraphics[j].parent.fit(FitOptions.proportionally);
myGraphics[j].parent.fit(FitOptions.centerContent);
// For text-wrap mode - Working
//myGraphics[j].textWrapPreferences.textWrapMode = TextWrapModes.CONTOUR;
//myGraphics[j].textWrapPreferences.textWrapOffset = [24,12,24,12];
}
The frame is persisting in the center and not moving, i need to move the frame at the top.
Kindly excuse me if i may post in different threads with the same scenario and if i posted any unwanted.
Regards,
Sathya Rani M
Jongware's script is working good for me,
for (p=0; pp=app.activeDocument.pages[p],p<app.activeDocument.pages.length; p++){
if (pp.allGraphics.length == 1){
pp.allGraphics[0].parent.move([pp.allGraphics[0].parent.geometricBounds[1], pp.marginPreferences.top]);
}
}
If it is not now working for you, you need to tell more about that. I mean in which case it is not working.
Green4ever
Do NOT say "it is not working". DO say "I get the error "xxxx"", or "The script moves the object off the page", or "The script makes my computer crash". ANYTHING MORE than "it is not working". ANYTHING more.
If you DID tell us the exact error message you got, it could have been something like
JavaScript error on line 22: Syntax error
Line:
myGraphics[j].parent.move[myY1,myX1];
... but since you did NOT tell us what went wrong, we have to read your script top to bottom for obvious errors, set up a test document that might or might not be exactly your document, copy the script into a new file, run the script and then see for ourself why "it is not working".
Hi All,
I got the solution through this link.
http://forums.adobe.com/message/4463129#4463129
Thank you for your support.
Regards,
Sathya Rani M
North America
Europe, Middle East and Africa
Asia Pacific