Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

URL and File related methods

Method

itemsIn:recursive:skipHidden:skipInsidePackages:asPaths:

Summary

Enumerate the directory (passed as an alias, file, HFS path, POSIX path or NSURL), and return an array of either paths or NSURLs of the contained folders, files and packages.

Signature

+ (NSArray *)itemsIn:(id)urlFileOrPath recursive:(BOOL)recurseFlag skipHidden:(BOOL)hiddenFlag skipInsidePackages:(BOOL)skipInPackagesFlag asPaths:(BOOL)pathsFlag

Parameters

urlFileOrPath = alias, file, HFS path, POSIX path or NSURL

recurseFlag = whether to recurse through any folders

hiddenFlag = whether to ignore hidden items

skipInPackagesFlag = whether to include items within file packages

pathsFlag = whether to return POSIX paths or NSURLs

Result

An array or list of POSIX paths or URLs

Availability

Version 1.3.0

Notes

 

Sample

use scripting additions

use framework "Foundation"

use script "BridgePlus"

load framework


set urlFileOrPath to "~/Desktop"

set theResult to current application's SMSForder's itemsIn:urlFileOrPath recursive:true skipHidden:true skipInsidePackages:true asPaths:true

ASify from theResult

--> <recursive list of POSIX paths of files on Desktop>

theResult as list

--> <recursive list of POSIX paths of files on Desktop>

set theResult to current application's SMSForder's itemsIn:urlFileOrPath recursive:true skipHidden:true skipInsidePackages:true asPaths:false

ASify from theResult

--> <recursive list of file references of files and folders on Desktop>

theResult as list -- 10.11 only

--> <recursive list of file references of files and folders on Desktop>

theResult as list -- 10.9 and 10.10

--> <recursive list of NSURLs of files and folders on Desktop>


Click here to open script in a script editor