PDA

View Full Version : file..compare..return list...script is hanged


himanshu
11-22-2010, 04:22 AM
--I have a list of files have extension *.txt, I m getting list by shell script, and I have hard coded file list in string array...I am comparing both and want files are not there getting in shell script..the script logic is correct..but getting hanged..I try to show o/p as not contain files
-- I will modify same script to get only file name and trim path...I do not want to hard code path in string array and also in shell script
set fileList to {}
set qtypefile to quoted form of ".txt"
set returnFiles to paragraphs of (do shell script "mdfind -onlyin / " & qtypefile)
--return choose from list returnFiles
set myNewList to ""
set myNotList to {"path1/1.txt",path1/2.txt",path1/3.txt" }
tell application "Finder"
repeat with i in myNotList
repeat until i contains returnFiles
if i is not in returnFiles then
return choose from list returnFiles
end if
end repeat
end repeat
end tell

renaultssoftware
11-22-2010, 06:59 AM
Himanshu, please understand that shell scripts and AppleScripts are rarely cross-compatible. That is, output from one can disagree with the other - so it's better that you work files with one or the other. How about you tell us why, not what, is the goal of this?

renaultssoftware
11-22-2010, 07:44 AM
If you have no reason to do this, why are you doing this?

himanshu
11-24-2010, 04:14 AM
Himanshu, please understand that shell scripts and AppleScripts are rarely cross-compatible. That is, output from one can disagree with the other - so it's better that you work files with one or the other. How about you tell us why, not what, is the goal of this?

hayne gives me this answer

renaultssoftware
11-24-2010, 06:48 AM
So he does, for a good reason. He's asking you why so that we can possibly suggest a better method.