• 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: KOENIG Yvan <email@hidden>
  • Date: Wed, 2 Feb 2011 19:35:39 +0100


Hello

There is no property list file entry in dictionaries so, what you got seems logical.

Here is a quick and dirty way to get the wanted path.

--[SCRIPT]
set p2d to path to desktop folder
set plistName to "myPlist"
set un_record to {machin:"Truc"}
set path_to_my_plist to my makeNewPlistFile(p2d, plistName, un_record)

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"
try
the result as text
on error errMsg number errNbr
set path_to_plist to (item 2 of my decoupe(errMsg, quote)) as alias
end try
end tell
return path_to_plist
end makeNewPlistFile

--=====

on decoupe(t, d)
local oTIDs, l
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe

--=====
--[/SCRIPT]

Yvan KOENIG (VALLAURIS, France) mercredi 2 février 2011 19:34:57


 _______________________________________________
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

  • Follow-Ups:
    • Re: New plist File
      • From: Paul Berkowitz <email@hidden>
    • Re: New plist File
      • From: Luther Fuller <email@hidden>
References: 
 >New plist File (From: Luther Fuller <email@hidden>)

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