• 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: New plist File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New plist File


  • Subject: Re: New plist File
  • From: Stan Cleveland <email@hidden>
  • Date: Wed, 2 Feb 2011 12:41:08 -0800

On Feb 2, 2011, at 10:14 AM, Luther Fuller wrote:

<snip>

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.

Hi Luther,

How about this? One of the properties of a 
property list file
 is 
path
, 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}
set pFile to 
make new property list file with properties {contents:the result, name:newFileName}
return 
path 
of 
pFile
end tell
end makeNewPlistFile --------------------------------------------------------------------

Stan C.

 _______________________________________________
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: 
 >New plist File (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: New plist File
  • Next by Date: Re: New plist File
  • Previous by thread: Re: New plist File
  • Next by thread: Re: New plist File
  • Index(es):
    • Date
    • Thread