On Feb 2, 2011, at 2:29 PM, Stan Cleveland wrote:
How about this? One property of a
is
, which is an alias.
on makeNewPlistFile(folderAlias, filename, initialRecord)
set newFileName to (folderAlias as text) & filename & ".plist"
tell application "System Events"
make new property list item with properties {kind:record, value:initialRecord}
make new property list file with properties {contents:the result, name:newFileName}
end tell
end makeNewPlistFile --------------------------------------------------------------------
You're right. Thanks! Here's the updated handler ...
on makeNewPlistFile(folderAlias, filename, initialRecord)
set newFileName to (folderAlias as text) & filename
tell application "System Events"
make new property list item with properties {kind:record, value:initialRecord}
make new property list file with properties {contents:the result, name:newFileName}
set newFileName to (path of the result)
end tell
tell application "Finder" to update folder folderAlias -- This may not be necessary.
return (newFileName as alias)
end makeNewPlistFile --------------------------------------------------------------------
-- folderAlias is an alias to the location where the new file is created
-- filename is text, the name of the new file without ".plist"
-- initialRecord is an AppleScript record which becomes the content of the new file
I put the 'update folder ...' in as a possible fix for another problem not related to plist files.