Rép: read a plist
Rép: read a plist
- Subject: Rép: read a plist
- From: KOENIG Yvan <email@hidden>
- Date: Tue, 15 Jan 2008 21:44:02 +0100
Le 15 janv. 2008 à 21:31, Luther Fuller a écrit :
This code has been working for years ...
tell application "System Events" -- read from Info.plist file in
bundleRef = source bundle
(item "Info.plist" of folder "Contents" of bundleRef) as alias
set InfoRecord to (value of property list file (POSIX path of the
result))
end tell
tell application "System Events" -- read ScriptBundleToolUserItems
in project.plist file
(item "project.plist" of contentsSource) as alias
POSIX path of the result
value of property list item "ScriptBundleToolUserItems" of
property list file the result
end tell
set InfoRecord to the result & InfoRecord
tell application "System Events" -- write to Info.plist file in
bundleRef = source bundle
(item "Info.plist" of folder "Contents" of bundleRef) as alias
set (value of property list file (POSIX path of the result)) to
InfoRecord
end tell
Thanks.
Just after posting I discovered that I was able to get the result with:
set thePlist to "Macintosh
HD:Users:yvankoenig:Library:Preferences:com.apple.iWork.Numbers.plist"
tell application "System Events"
tell contents of property list file thePlist
{value of property list item "LSDocumentDefaultSaveDirectory"}
end tell
end tell
But I always wish to know how I would be able to pass from
"Macintosh
HD:Users:yvankoenig:Library:Preferences:com.apple.iWork.Numbers.plist"
to an UNIX path usable in the code.
On the other hand, how may I get the HFS path equivalent to:
"/Volumes/AluIce250_2/Desktop"
for instance (here, AluIce250_2 is NOT the boot volume)
A friend gave me a script which unescape the path but there is a
surprizing feature.
It seems that the normal coding for the "è" character is "è"
But I got pathnames in which "è" is coded "è"
Is it normal?
Yvan KOENIG
_______________________________________________
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