Re: List content of a folder, output to document
Re: List content of a folder, output to document
- Subject: Re: List content of a folder, output to document
- From: "Stockly, Ed" <email@hidden>
- Date: Tue, 05 Jan 2010 14:56:46 -0800
- Thread-topic: List content of a folder, output to document
Title: Re: List content of a folder, output to document
This may get you started.
Paste it into your script editor click “Run”
HTH,
ES
set myFolder to choose folder
set folderPath to POSIX path of myFolder
tell application "Finder"
set myContents to entire contents of myFolder as alias list
end tell
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {folderPath}
set newList to {}
repeat with thisItem in myContents
set thisPath to POSIX path of thisItem
set the end of newList to text item 2 of thisPath
end repeat
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {return}
set myList to newList as text
set AppleScript's text item delimiters to oldDelims
tell application "Finder"
display dialog myList
end tell
On 1/5/10 2:37 PM, "Inge Eidem" wrote:
Hi
Can you help me?
I need to get a folder´s content/items to be listed in a file for archiving.
I want to choose a folder and get the context menu on the folder to run the script, after starting the script ill end up with a file containing filnames, subfolders and filenames as a list in a text document. Is this possible?
This is what i hope to get in the file:
/index.html
/subfolder1/image.jpg
/file2.txt
/subfolder2/subsubfolder1/meta.qsl
I tried to get spotlight metadata but it was just not what i wanted as output.
Something like this??
tell application "Finder"
try
set filesList to files of sourceFolder as alias list
on error
set filelist to files of sourceFolder as alias as list
end try
end tell
--
Best Regards,
Inge Eidem
Daglig leder
Zummit
_______________________________________________
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
_______________________________________________
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