Do shell script
Do shell script
- Subject: Do shell script
- From: Richard Rönnbäck <email@hidden>
- Date: Wed, 15 Oct 2003 07:38:27 +0200
Hello,
I have been noticing some very interesting threads recently about finding
files with the help of Shell Script. I have been trying that myself, but
unfortunately I run into trouble when the filename contains special
characters, such as brackets, spaces etc. and since I have *very* limited
knowledge of Unix encodings and search strings I don't know how to deal with
that. Does anyone know of a way to handle this?
This works:
set myFolder to alias (((path to current user folder) as string) &
"Documents") -- in the actual script, the user chooses a folder
set myFolder to quoted form of (POSIX path of myFolder)
set myFolder to text 1 thru -3 of myFolder & "'" --drop final "/"
set myFileName to "AnythingGoes.txt" as Unicode text
set myFoundFiles to every paragraph of (do shell script "find " & myFolder
& " -name " & myFileName & " -type f")
This doesn't
set myFolder to alias (((path to current user folder) as string) &
"Documents") -- in the actual script, the user chooses a folder
set myFolder to quoted form of (POSIX path of myFolder)
set myFolder to text 1 thru -3 of myFolder & "'" --drop final "/"
set myFileName to "AnythingGoes(Copy).txt" as Unicode text
set myFoundFiles to every paragraph of (do shell script "find " & myFolder
& " -name " & myFileName & " -type f")
Nor would this
set myFileName to "Anything Goes.txt" as Unicode text
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.