Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Applescript > Re: Grabbing a ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1534 of 1611
Post > Topic >>

Re: Grabbing a catalog of a Finder window or folder's (nested) contents?

by John Rethorst <nobody@[EMAIL PROTECTED] > Nov 17, 2007 at 11:34 AM

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




 1 Posts in Topic:
Re: Grabbing a catalog of a Finder window or folder's (nested) c
John Rethorst <nobody@  2007-11-17 11:34:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 20:24:25 CDT 2008.