Skip to main content
Known Participant
December 18, 2009
Answered

AS CS3 Zoom

  • December 18, 2009
  • 1 reply
  • 806 views

I'm still a newbie to applescript. I'm trying to make the window fit to page. What am I doing wrong?.

This is the chunk I need help with out of my bigger script:

try

tell layout window of MyDoc

set zoom percentage to fit window

end tell

end try

I also want to set the screen mode to Normal too. What's the code for that?

This topic has been closed for replies.
Correct answer sstanleyau

I expect Shane'll be along soon to help out here, but it's probably something like:


tell layout window of myDoc

     zoom with fit page

end tell

Although, that might need to be: tell layout window 1 of myDoc because a document can have more than one layout window open.

Dave


Close -- try:

tell layout window 1 of document 1

zoom given fit page

end tell

1 reply

Inspiring
December 18, 2009

I'm a bit rusty with AS syntax, but the problem is that you're trying to set the zoom percentage property and that only takes a number. To use the zoom options you need to use the window's zoom method (JS calls it a method) and then you can use the zoom options to fit to window.

Dave

kermy812Author
Known Participant
December 18, 2009

Still not figuring out the syntax/code. Somewhat still new to scripting.

Inspiring
December 18, 2009

I expect Shane'll be along soon to help out here, but it's probably something like:


tell layout window of myDoc

     zoom with fit page

end tell

Although, that might need to be: tell layout window 1 of myDoc because a document can have more than one layout window open.

Dave