Re: How to get a string of full paths from all files inside a folder (including subfolders)
Re: How to get a string of full paths from all files inside a folder (including subfolders)
- Subject: Re: How to get a string of full paths from all files inside a folder (including subfolders)
- From: Takaaki Naganoya via AppleScript-Users <email@hidden>
- Date: Wed, 8 Dec 2021 00:46:10 +0900
Hi,
> 2021/12/08 0:09、Bert Groeneveld via AppleScript-Users
> <email@hidden>のメール:
>
> OR: how can I do this without using SatimageOSAX?
There is a lot of way to do it.
This script does not need SatimageOSAX.app.
Spotlight search may not work on server, so I recommend to use NSFileManager.
<AppleScript>
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"
property NSString : a reference to current application's NSString
property NSPredicate : a reference to current application's NSPredicate
property NSFileManager : a reference to current application's NSFileManager
property NSMutableArray : a reference to current application's NSMutableArray
set aFol to POSIX path of (choose folder)
set aList to retFullPathWithinAFolderWithRecursive(aFol) of me
on retFullPathWithinAFolderWithRecursive(aFol)
set anArray to NSMutableArray's array()
set aPath to NSString's stringWithString:aFol
set dirEnum to NSFileManager's defaultManager()'s enumeratorAtPath:aPath
repeat
set aName to (dirEnum's nextObject())
if aName = missing value then exit repeat
set aFullPath to aPath's stringByAppendingPathComponent:aName
anArray's addObject:(aFullPath as string)
end repeat
return anArray as list
end retFullPathWithinAFolderWithRecursive
</AppleScript>
Takaaki Naganoya
--
Takaaki Naganoya
email@hidden
http://piyocast.com/as/
_______________________________________________
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