Please Help me fixing old script by Harb
Hi Experts,
i use Harb Script found here in the forum and in his website ( ) , here is the code :
"http://in-tools.com/article/scripts-blog/separate-pages-script/"
/*****************************************************
SeparatePages.jsx
An InDesign CS2 javascript by Harbs.
For more scripts and automation tools visit www.in-tools.com.
Will separate all pages to allow for inner bleeds
while preserving the original orientation of the page.
Basic testing done on CS2 ME. (Should work with CS and CS3 also, but untested.)
Use at your own risk!!!
*******************************************************/
aDoc = app.activeDocument;
for (i=0;i<aDoc.pages.length;i++){
aSide = aDoc.pages[i].side;
aSide = aSide + "";
aDoc.pages[i].insertLabel("direction",aSide);
}
aDoc.documentPreferences.allowPageShuffle = true;
aDoc.documentPreferences.facingPages = false;
aDoc.documentPreferences.allowPageShuffle = false;
aDoc.documentPreferences.facingPages = true;
for (i=0;i<aDoc.pages.length;i++){
myPage = aDoc.pages[i];
mySide = myPage.extractLabel("direction");
if (mySide == "1818653800"){
myPage.move(LocationOptions.atEnd,myPage,BindingOptions.leftAlign);
}else{
myPage.move(LocationOptions.atEnd,myPage,BindingOptions.rightAlign);
}
}
i see after running the script that the splitted pages have items moved to the left (images and text frames), that including images and text frame!, I don't know why, no error messages! but it moves to left, thats mean vandalize the document!
Please can you help me to identify the problem, i still learning javascript so i can't figure where is the problem?, here is screen shots.


Thanks in Advance
Best
M.Hasanain