Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Detect Full Screen?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detect Full Screen?




On Jul 25, 2011, at 9:18 AM, Doug Adams wrote:

tell application "Finder"
set bigBounds to (get bounds of window of desktop)
end tell

tell application "iTunes"
set iBounds to (get bounds of front browser window)
if bigBounds = iBounds then
log "FULL SCREEN"
else
log "NOT FULL SCREEN"
end if
end tell

This is one of those rare cases where GUI Scripting is actually better:

tell application "System Events"
tell process "Safari" -- or whatever
get value of attribute "AXFullScreen" of window 1
end tell
end tell
display dialog result as text

You have to put the script in the Scripts folder and run it from the Scripts menu when the target window is in fact full screen. Running it from Script Editor in another space doesn't see the Safari window, as far as I can tell on a quick test.

-- 

Bill Cheeseman - email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Detect Full Screen? (From: Doug Adams <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.