• 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: Unable to open Word Mac documents in Hidden state
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to open Word Mac documents in Hidden state


  • Subject: Re: Unable to open Word Mac documents in Hidden state
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 11 Feb 2010 08:40:59 -0600

On Feb 11, 2010, at 1:56 AM, SHIVANK AGGARWAL, Noida wrote:

Please let me know how I can access the values from a plist using Applescript
 
Like I have a attribute ownerid = “Shivank” in plist how can I access that value using applescript.

The basic technique is to read & write the entire plist file.
Like this ...

-- prefsFile is an alias to a preference file (or any .plist file)
tell application "System Events"
set prefsRec to (value of property list file ((prefsFile as text))) --<<<<<< READ
end tell

-- prefsRec is an AppleScript record. Modify this record as desired.

tell application "System Events"
set value of property list file (prefsFile as text) to prefsRec -- <<<<<<< WRITE
end tell

If the .plist file is large, you may want to read & write only a single key in the file.
Like this ...

-- prefsFile is an alias to a preference file (or any .plist file)
-- "someKey" is the name of an item of the plist file at the root level.
tell application "System Events"
set myKeyValue to (value of property list item "someKey" of property list file (prefsFile as text))
end tell

-- the class of myKeyValue is the class of the key as shown in the .plist file
-- array = list, Dictionary = record, the others are obvious
-- modify myKeyValue as desired, then

tell application "System Events"
set (value of property list item "someKey" of property list file (prefsFile as text)) to myKeyValue
end tell

Writing the .plist file is necessary only if you need to save the modified value.

 _______________________________________________
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: Unable to open Word Mac documents in Hidden state (From: "SHIVANK AGGARWAL, Noida" <email@hidden>)

  • Prev by Date: Re: Stuffit Deluxe not applescriptable in 10.6.2
  • Next by Date: Re: Number to words [Re: Excel & AppleScripting]
  • Previous by thread: RE: Unable to open Word Mac documents in Hidden state
  • Next by thread: Re: Open a linked jpeg in Photoshop instead of the browser itself
  • Index(es):
    • Date
    • Thread