Property
List Tools 1.0.6
Download Version 1.0.6 (152KB)
The Property List Tools Scripting Addition allows AppleScript to load
and store Mac OS X Property Lists. The scripting addition allows
you to export any AppleScript data structure to a property list.
NOTE: If you are looking for a tool to simply parse
XML data, go to the XML Tools Web
page.
Credits/Legal
THIS SOFTWARE IS PROVIDED AS-IS,
WITHOUT WARRANTY OF ANY KIND. THE AUTHOR DISCLAIMS ANY DAMAGES THAT
MAY RESULT FROM THE USE OR MISUSE OF THIS SOFTWARE.
THIS SOFTWARE IS COPYRIGHT © 2006 LATE NIGHT SOFTWARE LTD. & MARK
ALLDRITT. YOU MAY USE AND/OR DISTRIBUTE THE SOFTWARE WITHOUT RESTRICTION.
IF YOU BUNDLE THE SOFTWARE WITH ANY COMMERCIAL OFFERING, YOU MUST DISPLAY
THIS COPYRIGHT NOTICE IN THE SOFTWARE'S DOCUMENTATION AND ABOUT
BOX.
System Requirements
The Property List Tools scripting
addition requires Mac OS X
10.3.9 or
later.
Installation Instructions
To install the Property List Tools scripting
addition on Mac OS X systems:
- Create a folder named ScriptingAdditions in your user account's Library folder
(known as ~/Library) if one does not already exist.
- Copy the Property List Tools.osax into the ~/Library/ScriptingAdditions folder.
Getting Started
The Property List Tools package contains a simple example
script that illustrates how to use the Property List Tools scripting
addition to read and write property list files containing various kinds
of data.
To view the Property List Tools dictionary, which lists all the commands
and their options, just drop the Property List Tools.osax file onto your
favorite script editor.
NOTE: The example scripts provided with Property List
Tools use the AppleScript path to me command. The path
to me command does not operate correctly when scripts are executed
from within Apple's Script Editor. The examples were developed
using our Script Debugger software,
which does not have this limitation.
Here is some example code illustrating how Property List Tools can be
used:
set myFolder to path
to desktop
folder as string
-- It all works best with
user properties
store property list {|myName|:"Mark
Alldritt", |myAge|:42, today:current
date} in file (myFolder & "test1.plist")
read property list file (myFolder & "test1.plist")
tell application "Finder" to open alias (myFolder & "test1.plist")
-- show the generated
plist file
-- But the osax also supports
keyword properties
store property list {name:"Mark
Alldritt", |myAge|:42} in file (myFolder & "test2.plist")
read property list file (myFolder & "test2.plist")
tell application "Finder" to open alias (myFolder & "test2.plist")
-- show the generated
plist file
-- And finally, you can
store any kind of AEDesc that is not directly supported by the plist format
script testObj
property abc :
100
on testing()
return "Done!"
end testing
end script
store property list {|myName|:"Mark
Alldritt", |myData|:testObj} in file (myFolder & "test3.plist")
tell application "Finder" to open alias (myFolder & "test3.plist")
-- show the generated
plist file
set newTestObj to read
property list file (myFolder & "test3.plist")
tell |myData| of newTestObj to testing()
-- Result: "Done!"
Change History/Release Notes
1.0.6 June 7, 2006
- Support Mac OS X 10.3.9 systems.
- Resolve byte order issues on Intel machines.
- Properly handle boolean values on PowerPC machines.
1.0.5 April 21, 2006
- The Get Recent Files demo has been updated to work with Mac OS X
10.4.6.
- The Read Me First document once again directs you to this Web page.
1.0.4 March 31, 2006
- Native Intel Macintosh support (distributed as a Universal binary).
- The read property list command can now parse strings containing Property
List XML data.
- The store property list command can now return Property List XML
data as a string.
1.0.3 February 7, 2005
- Fixed a problem where integer values read from property lists were
converted to reals when they are written back to a property list file.
1.0.2 May 19, 2004
- Fixed a bug in the store property list command where
HFS file paths with file names greater than 31 characters in length
would be truncated.
To specify an HFS path with a lone file
name
you must
say: file "volume:folder:long-file-name.plist".
Use of AppleScript's file specification (FSSpec/typeFSS)
class will result in truncated file names. POSIX
file path specifications are not affected by this bug.
- Added a new example script (Get Recent Files.scpt) to the package.
1.0.1 April 7, 2004
- Fixed a crashing bug reading 64-bit integer values from a property
list file.
|