Re: Folder Type Identifier
Re: Folder Type Identifier
- Subject: Re: Folder Type Identifier
- From: Shane Stanley <email@hidden>
- Date: Wed, 14 Oct 2015 09:55:24 +1100
On 13 Oct 2015, at 11:11 PM, Thomas Fischer <email@hidden> wrote:
This doesn't seem to run on Mavericks.
You have to run it via a script library in Mavericks. Put the code in a handler, something like:
use scripting additions use framework "Foundation" on utiForPosixPath:thePath set theNSURL to current application's class "NSURL"'s fileURLWithPath:thePath set {theResult, theValue} to theNSURL's getResourceValue:(reference) forKey:(current application's NSURLTypeIdentifierKey) |error|:(missing value) return theValue as text end utiForPosixPath:
Save it as a .scptd file to ~/Library/Script Libraries (you'll probably have to create the folder). Then in Script Editor click on the toolbar at top-right to show a panel where you need to click the checkbox called AppleScript/Objective-C. Save again. Then run a script like this:
tell script "<name of lib>" set theResult to its utiForPosixPath:(POSIX path of (path to home folder)) end tell |
_______________________________________________
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