Table of Contents       9. AppleScript


9.3 Find by AppleScript

The most important feature in NeoFinder is certainly the Find function, as without it, your carefully cataloged data would be worthless. You can of course not only perform that Find with AppleScript, you can also access the results, the Found Items.


tell application "NeoFinder"
find "Star Trek"
end tell


This sample asks NeoFinder to find every file in every available catalog that contains the string "Star Trek".

Also, as a Find can take some time if you have a huge amount of catalogs, you may want to use the with timeout of statement as described above to prevent errors from occurring.

After the Find is complete, you can access the attributes of all found items:


tell application "NeoFinder"
with timeout of 2000 seconds -- remember: this might take more than the default 60 seconds!
find "Star Trek"
end timeout

set numResults to found items amount
repeat with i from 1 to numResults
tell found item index i
set myName to name
set myPath to complete path
set mySize to size
set myKind to kind
end tell
end repeat
end tell