• 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: Folder Type Identifier
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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: 
 >Shell script to get a list of all subfolders inside a folder (From: Bert Groeneveld <email@hidden>)
 >Re: Folder Type Identifier (From: Shane Stanley <email@hidden>)
 >Re: Folder Type Identifier (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Shell script to get a list of all subfolders inside a folder
  • Next by Date: Re: Shell script to get a list of all subfolders inside a folder
  • Previous by thread: Re: Folder Type Identifier
  • Next by thread: Re: Folder Type Identifier
  • Index(es):
    • Date
    • Thread