• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: get size of available screen fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >get size of available screen fails (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: How do I delete the 1st three characters from a variable
  • Next by Date: Re: How do I delete the 1st three characters from a variable
  • Previous by thread: get size of available screen fails
  • Next by thread: Re: get size of available screen fails
  • Index(es):
    • Date
    • Thread