Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Do shell script help



Hi,

I have written a droplet that uses a shell script (from macosxhints) to identify potential duplicate files, this works beautifully on my laptop but fails on my desktop machine.

If I remove the "try" I get an applescript error that appears to be the names of duplicate files, so it looks like the "do shell script" is working (it also works in the Terminal) but for some reason I can't set the_results to the text returned from the shell script?

Many Thanks,

Chris

The droplet can be downloaded from my idisk
http://idisk.mac.com/swain-Public?view=web


The script is shown below.

-- This uses
-- dupecheck - identify potential duplicates of a file using Spotlight metadata

to open the_file
set the_results to ""
set posix_path to quoted form of the POSIX path of the_file
set dup_path to (path to me as string)
set full_dup_path to dup_path & "Contents:Resources:Scripts:dupecheck"
set dup_path_posix to quoted form of the POSIX path of full_dup_path



set the_script to dup_path_posix & " " & posix_path


--display dialog the_script


try
set the_results to do shell script the_script



end try


if the_results = "" then
display dialog "No duplicates found"
else
set num_files to the number of paragraphs in the_results



display dialog "The number of duplicates is " & num_files & return & return & the_results buttons {"Finish", "Show All"} default button 2
if the button returned of the result is "Show All" then


repeat with i from 1 to num_files
set result_1 to paragraph i of the_results
--display dialog result_1
set the_dup_file to POSIX file result_1
--display dialog the_dup_file
tell application "Finder"
activate
select the_dup_file
end tell


end repeat
else
-- do nothing
end if
end if

end open




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.