• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Do shell script help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Do shell script help


  • Subject: Do shell script help
  • From: Chris Swain <email@hidden>
  • Date: Thu, 9 Nov 2006 22:59:54 +0000

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
-- see http://www.macosxhints.com/article.php?story=20061003163429425

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:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Do shell script help
      • From: Christopher Nebel <email@hidden>
    • Is this a known bug?
      • From: Adam Bell <email@hidden>
  • Prev by Date: osxutils and accented chars
  • Next by Date: Is this a known bug?
  • Previous by thread: Re: osxutils and accented chars
  • Next by thread: Is this a known bug?
  • Index(es):
    • Date
    • Thread