• 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
Re: applescript-users digest, Vol 3 #2135 - 16 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescript-users digest, Vol 3 #2135 - 16 msgs


  • Subject: Re: applescript-users digest, Vol 3 #2135 - 16 msgs
  • From: Graff <email@hidden>
  • Date: Thu, 06 Nov 2003 23:40:04 -0500

I hope you don't mind but I took the liberty of fixing your problem and also simplifying your code a bit.

Things like this are a little bit easier to do with recursion, here is a good tutorial on it:
<http://maccentral.macworld.com/features/applescriptprimer32/>

I basically re-coded the part of your script that did the clearing. Now it will clear everything in the target folder without any need to bring the Finder forward or to open any windows. It just clears the comments in the background and reports that it did so.

Here's the code, I hope this helps you out.

- Ken

code:

--this runs if the icon is double-clicked
on run
set badfolder to choose folder with prompt ,
"Choose a folder with bad picture files"
clearcomment(badfolder)
end run

--this runs if a file is dropped on the icon
on open openedfolder
set badfolder to openedfolder as alias
clearcomment(badfolder)
end open

-- here is the main function that triggers the recursion
on clearcomment(badfolder)
RecursiveClear(badfolder)
beep
display dialog "Comments Cleared" with icon note giving up after 2
end clearcomment

-- here is the recursive function that does the work on RecursiveClear(currentFolder)
tell application "Finder"
set comment of every item in currentFolder to ""
set allFolders to every folder of currentFolder
repeat with newFolder in allFolders
my RecursiveClear(newFolder)
end repeat
end tell
end RecursiveClear

On Thu, 6 Nov 2003 12:56:54 -0500, Christopher MJ Tangora <email@hidden> wrote:

I am writing a script to open a folder, set it to expanded list view,
then select all the files in the window and change the comment field to
nothing. I have gotten it to work, except for the part about selecting
the entire container window. I tried recording a similar action
(select all and then label everything), but when I used that command,
it only selects the items in the original folder.

Can someone show me how to select the entire contents of the
container window?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: applescript-users digest, Vol 3 #2135 - 16 msgs
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Multi-threaded - thanks
  • Next by Date: Re: Entourage -> rule -> attachments
  • Previous by thread: Re: Multi-threaded - thanks
  • Next by thread: Re: applescript-users digest, Vol 3 #2135 - 16 msgs
  • Index(es):
    • Date
    • Thread