In article <Bux%i.5157$Ji6.3317@[EMAIL PROTECTED]
>, me@[EMAIL PROTECTED]
(Király)
wrote:
> ls -R /path/to/folder > ~/Desktop/list.txt
I thought I'd put this in an Applescript droplet for convenience. Works
fine as
a shell script, but I wanted to add the folder's name to "List.txt" and
can't
get that to work:
on open theDrop
if (count theDrop) > 1 then
display dialog "Please drop only one folder at a time on me." with
title
"Folder List" buttons {"OK"} default button 1 with icon caution
return
end if
set theFolder to item 1 of theDrop
set folderInfo to (info for theFolder)
if not folder of folderInfo then
display dialog "Please drop only a folder on me." with title "Folder
List"
buttons {"OK"} default button 1 with icon caution
return
end if
set folderName to name of folderInfo
set theFolder to POSIX path of theFolder
--set scriptCommand to "ls -R " & theFolder & ("> ~/Desktop/" &
folderName &
" List.txt")
--> Error "ls: List.txt: No such file or directory"
set scriptCommand to "ls -R " & theFolder & ("> ~/Desktop/List.txt")
--> works
do shell script scriptCommand
end open
--
John Rethorst
jrethorst at post dot com