New plist File
New plist File
- Subject: New plist File
- From: Luther Fuller <email@hidden>
- Date: Wed, 02 Feb 2011 12:14:14 -0600
In the past, there has been comment on the inability of System Events to make a new property list file. I have been using 'do shell script "defaults write " & ... ' to do this, but wanted to find another way.Yesterday, I Googled "property list file" and found some interesting results. This lead to this handler ...
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} --> «class plif» "/Users/lutherfuller/Desktop/TEST_FILE.plist" end tell 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
It works very well, but I would like it to return an alias to the new file. That is, return the last line as an alias.
This seems impossible to do. Neither System Events nor the Finder nor anything else seems to know what a «class plif» is. All I can get is an error message. It is impossible to convert this to an alias, a posix path, a text path or a reference.
Does anyone know what's happening here?
|
_______________________________________________
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