name of the front windows application
name of the front windows application
- Subject: name of the front windows application
- From: Robert Poland <email@hidden>
- Date: Mon, 8 Aug 2005 11:30:53 -0600
Hi,
OS 10.4.2. I have this script (below) that I would like to be able to
run on the front application, Safari and iTunes, and possibly others.
What I am trying to do is get the name of the foremost application
and apply the script to it. I am having trouble getting the name of
the front windows application.
The script is activated by an iKey command.
on main()
-- newL - left border, newT - top border
set wd to (word 3 of (do shell script "defaults read
/Library/Preferences/com.apple.windowserver | grep -w " & "Width"))
as number
set ht to (word 3 of (do shell script "defaults read
/Library/Preferences/com.apple.windowserver | grep -w " & "Height"))
as number
set newT to 22
if wd > 800 then
set newL to 145
else
set newL to 0
end if
tell application "System Events"
if exists (processes whose name contains "Safari") then
if exists {window 1} then
tell application "Safari"
activate
set bounds of window 1 to
{newL, newT, wd, ht}
end tell
end if
end if
end tell
return
end main
on run
main()
end run
--
Bob Poland - Fort Collins, CO
http://www.ibrb.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden