Hard to read the screenshot. next time cut and paste the test into the reply. Also select Replies as the display for the window in Applescript.
The error you get, the no such file or directory are you sure that the file exists? Looks like the file is called List and it is in your desktop?
Just tried it here and it is working OK
Here is another copy just in case something got messed up in the first one:
(*
The patteren file is the smaller file with the URLs that we will lok for in the URL file
*)
set file1 to POSIX path of (choose file with prompt "Select patteren file:" default location alias (the path to desktop folder as text))
set file2 to POSIX path of (choose filewith prompt "Select URL file:" default locationalias (the path todesktop folderastext))
do shell script "grep -o -E '(https?|ftp|file)://.+' " & file1 & " > ~/patternFile"
do shell script "grep -o -E '(https?|ftp|file)://.+' " & file2 & " > ~/urlFile"
do shell script "grep -v -f ~/patternFile ~/urlFile > ~/missingUrlFile"
--- stop copying above this line
Just so you can see what the output in the Replies window of Applescript will look like:
tell current application
path todesktopastext
--> "Mac OS Lion:Users:frank:Desktop:"
end tell
tell application "AppleScript Editor"
choose file with prompt "Select patteren file:" default location alias "Mac OS Lion:Users:frank:Desktop:"
--> alias "Mac OS Lion:Users:frank:Desktop:f1"
end tell
tell current application
path todesktopastext
--> "Mac OS Lion:Users:frank:Desktop:"
end tell
tell application "AppleScript Editor"
choose file with prompt "Select URL file:" default location alias "Mac OS Lion:Users:frank:Desktop:"
--> alias "Mac OS Lion:Users:frank:Desktop:f2"
end tell
tell current application
do shell script "grep -o -E '(https?|ftp|file)://.+' /Users/frank/Desktop/f1 > ~/patternFile"
--> ""
do shell script "grep -o -E '(https?|ftp|file)://.+' /Users/frank/Desktop/f2 > ~/urlFile"
--> ""
do shell script "grep -v -f ~/patternFile ~/urlFile > ~/missingUrlFile"
--> ""
end tell
Result:
""
Message was edited by: Frank Caggiano - See Tony's post below