Your code shows perfect landscape value "alert(app.activeDocument.documentPreferences.pageOrientation);" . Is it problem with document or script?
No, the script shows PORTRAIT when I do an "alert (app.activeDocument.documentPreferences.pageOrientaion)" even though the document setup is "landscape" in InDesign. Do you have any ideas?
Have you tried this setting:
app.documentPreferences.pageOrientation = 2003395685;
I use, among other settings, in my startup script:
app.documentPreferences.pageSize = 'A4'; // The size of the page. //app.documentPreferences.pageOrientation = 2003395685; // The page orientation. 2003395685 = 'wide' app.documentPreferences.pageOrientation = 1751738216; // The page orientation. 1751738216 = 'high'
Hope this helps ...
1 person found this helpful
Could you try running this script?
var myPageOrientation = app.documents.item(0).documentPreferences.pageOrientation;
alert("Page Orientation: Portrait");
alert("Page Orientation: Landscape");
alert("Unknown Page Orientation");
If it reports that the orientation is other than what you see in the user interface, I'd try exporting the file to IDML and then opening the IDML file. If the file was converted from another application, or even from another version of InDesign, this should clear up the problem.
Thanks for your reply! Your suggestion worked with CS4! I'm curious as to why that worked....