• 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: How to get a string of full paths from all files inside a folder (including subfolders)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >How to get a string of full paths from all files inside a folder (including subfolders) (From: Bert Groeneveld via AppleScript-Users <email@hidden>)

  • Prev by Date: How to get a string of full paths from all files inside a folder (including subfolders)
  • Next by Date: Re: How to get a string of full paths from all files inside a folder (including subfolders)
  • Previous by thread: How to get a string of full paths from all files inside a folder (including subfolders)
  • Next by thread: Re: How to get a string of full paths from all files inside a folder (including subfolders)
  • Index(es):
    • Date
    • Thread