Re: get size of available screen fails
Re: get size of available screen fails
- Subject: Re: get size of available screen fails
- From: Norman Cohen <email@hidden>
- Date: Tue, 3 Jan 2006 18:11:52 -0800
It might be related to the fact that plist files are now saved in a
binary format for better performance and need to be converted to a
text format for what you want to do. The plutil unix command does the
translation (see man plutil in the terminal):
sudo plutil -convert xml1 /Library/Preferences/
com.apple.windowserver.plist
Will convert the file in place, then you should be able to search for
your xml tag. When you are done, convert the file back using the
following command:
sudo plutil -convert binary1 /Library/Preferences/
com.apple.windowserver.plist
Hope this helps,
Norm
---
Norman A. Cohen
email@hidden
"As far as the laws of mathematics refer to reality, they are not
certain; and as far as they are certain, they do not refer to reality."
Albert Einstein
On Jan 3, 2006, at 17:31 PM, Robert Poland wrote:
Hi,
For some reason the following seems to have quit working, It
generates an error, "Can't set text item delimiters to "<key>Width</
key>". It has been working for ages. No recent changes that I
remember. I have tried restarting Smile and re-launching the Finder.
Any Ideas?
Tia,
-- get size of available screen
set l to {}
set p to read file ((path to "pref" from local domain as Unicode
text) & "com.apple.windowserver.plist")
repeat with v in {"Width", "Height"}
set text item delimiters to "<key>" & v & "</key>"
set l's end to middle word of paragraph 2 of p's text item 2 as
integer
end repeat
set text item delimiters to {""}
set topLimit to 44 -- top edge
set leftLimit to 1 -- left edge
set rightLimit to (text item 1 of l) as number -- actual size of
screen
set bottomLimit to (text item 2 of l) as number -- actual size of
screen
_______________________________________________
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