RE: AppleScript-Users Digest, Vol 7, Issue 10
RE: AppleScript-Users Digest, Vol 7, Issue 10
- Subject: RE: AppleScript-Users Digest, Vol 7, Issue 10
- From: "Ripka, Herb" <email@hidden>
- Date: Wed, 6 Jan 2010 06:38:52 -0600
- Acceptlanguage: en-US
- Thread-topic: AppleScript-Users Digest, Vol 7, Issue 10
Message: 5
Date: Tue, 5 Jan 2010 23:37:54 +0100
From: Inge Eidem <email@hidden>
Subject: List content of a folder, output to document
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset="iso-8859-1"
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
************************************************
Inge--
For the chosen folder, this script finds all folders, subfolders and items inside those folders, along with their paths, output to a TextEdit window:
set f to (choose folder)
tell application "Finder" to set e to f's entire contents
if e = {} then
beep
display dialog "No items found in the folder “" & f & "”." buttons {"Cancel"} default button 1 with icon 0 giving up after 10
else
set filelist to {"Contents of " & f & return & return}
repeat with i from 1 to (count e)
set end of filelist to ("" & e's item i & return)
end repeat
set the clipboard to "" & filelist
beep 2
end if
tell application "TextEdit"
make new document at beginning with properties {text:filelist as Unicode text}
activate
end tell
--Herb Ripka
Greendale, WI
_______________________________________________
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