-
1. Re: [JS][CS5] resize document
Harbs. Feb 15, 2011 7:06 AM (in response to Roy Marshall)Set the margins to 0
Harbs
-
2. Re: [JS][CS5] resize document
Roy Marshall Feb 15, 2011 9:27 AM (in response to Harbs.)Thanks Harbs, but I already set them all to 0. The weird thing is I
can change the size in InDesign itself to the value needed without any
problems.
I have also changed the margins on the master pages too
Thanks for the suggestion though.
Roy
-
3. Re: [JS][CS5] resize document
booyajamo Aug 16, 2011 7:58 AM (in response to Roy Marshall)Hi Roy,
I'm having the same problem. Have you found any solution? I've been searching the internet and the INDD scripting guides I have and can't find anything. Hoping you've had luck!
Thanks,
Lindsay
-
4. Re: [JS][CS5] resize document
Roy Marshall Aug 22, 2011 4:17 PM (in response to booyajamo)Hi Lindsay.
I managed to get around to getting this sussed. I think I have it.
It is all to do with the application margin preferences, and the document margin preferences.
My code below does work, and resets the application margins back too which is useful:
myOldTop = app.marginPreferences.top; myOldLeft = app.marginPreferences.left; myOldRight = app.marginPreferences.right; myOldBottom = app.marginPreferences.bottom; app.marginPreferences.left = 0; app.marginPreferences.right = 0; app.marginPreferences.top = 0; app.marginPreferences.bottom = 0; myDoc.marginPreferences.left = 0; myDoc.marginPreferences.right = 0; myDoc.marginPreferences.top = 0; myDoc.marginPreferences.bottom = 0; myPage = myDoc.pages[0]; myPage.marginPreferences.left = 0; myPage.marginPreferences.right = 0; myPage.marginPreferences.top = 0; myPage.marginPreferences.bottom = 0; for(i=0;i<=myMasterSpreads.length-1;i++){ myMasterSpread = myMasterSpreads[i]; for(x = 0;x<=myMasterSpread.pages.length-1;x++){ myMasterSpread.pages[x].marginPreferences.right = 0; myMasterSpread.pages[x].marginPreferences.left = 0; myMasterSpread.pages[x].marginPreferences.top = 0; myMasterSpread.pages[x].marginPreferences.bottom = 0; } } //do the stuff you need to do app.marginPreferences.left = myOldLeft; app.marginPreferences.right = myOldRight; app.marginPreferences.top = myOldTop; app.marginPreferences.bottom = myOldBottom;All the master spreads margins are changed to 0, the document preferences are changed to 0, and the application preferences are changed to 0. It looks like all these need to be 0 before you can make the small page size.
Obviously I have left out the error controls, the actual resizing bit, but this chunk above manages to sort out the page being resized to a small size.
Let me know if this helps you.
Roy
-
5. Re: [JS][CS5] resize document
Roy Marshall Aug 22, 2011 4:38 PM (in response to Roy Marshall)also, and I haven't tested this, but I suspect that the application preferences dont need to be changed, just the page, masterpages and document preferences.
-
6. Re: [JS][CS5] resize document
booyajamo Aug 22, 2011 6:55 PM (in response to Roy Marshall)Hi Roy,
Thanks for the response! Did you see my post here http://forums.adobe.com/thread/892458?tstart=0
There are some great solutions there as well.
Thanks again!
Lindsay
-
7. Re: [JS][CS5] resize document
Roy Marshall Aug 22, 2011 7:57 PM (in response to booyajamo)Ah yes. The same problem tackled in a slightly different way. Did you get the answer you were looking for? Were you able to sort out your script?
Cheers
Roy
-
8. Re: [JS][CS5] resize document
Sergey Anosov Aug 29, 2011 1:39 PM (in response to Roy Marshall)Hi Roy!
Sometimes I need to change document page size according to selection size. Let me offer a script for this case:
https://sites.google.com/site/dtpscripting/indesign-scripts/fitpagetoselection-jsx
Best wishes,
Sergey
-
9. Re: [JS][CS5] resize document
Roy Marshall Aug 29, 2011 6:21 PM (in response to Sergey Anosov)Hi Sergey.
Took a look at your site. Most impressive! The script I created does what I want, yours is a lot deeper than I needed, but will bear it in mind.
I have taken your crop mark script though, I have a basic version, but your is way better!
Cheers
Roy
-
10. Re: [JS][CS5] resize document
Sergey Anosov Aug 30, 2011 12:00 AM (in response to Roy Marshall)Okay! You are welcome!



