• 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: How to pick user selected files only from one folder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to pick user selected files only from one folder?


  • Subject: Re: How to pick user selected files only from one folder?
  • From: Matthew Smith <email@hidden>
  • Date: Fri, 13 Jan 2006 17:27:02 +1100
  • Thread-topic: How to pick user selected files only from one folder?

Title: Re: How to pick user  selected files only from one folder?
You need to check it in your repeat loop. You can’t ask for selection of a specific folder.

You should also check to see if the item is a file. It could be a folder. You need to do this inside the repeat loop too.

tell application "Finder"
    activate
   set sourceItems to the selection
   repeat with thisItem in sourceItems
       if (get container of thisItem as Unicode text) is "
Macintosh HD:xxx:" then
           -- process
       end if
   end repeat
end
tell

--
Matthew Smith



From: Erkki Pennanen <email@hidden>
Date: Fri, 13 Jan 2006 08:15:48 +0200
To: <email@hidden>
Subject: How to pick user  selected files only from one folder?

I should pick user selected files and process them. The command "
set sourceItems to the selection" works fine, but it selects all files also from other folders, too. I should restrict the selection only to user selected files in a  spesific folder. The sentence "set sourceItems to the selection of folder "Macintosh HD:xxx" compiles but is giving error. Is there some way to solve this? I have tried already "tell folder .... end tell", but it doesn´t work either.


tell application "Finder"
       activate
      set sourceItems to the
selection
      -- set sourceItems to the selection of folder "Macintosh HD:xxx"
      display dialog sourceItems as
text
     repeat with thisItem in sourceItems
             -- my process code
      end repeat
end tell

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How to pick user selected files only from one folder? (From: Erkki Pennanen <email@hidden>)

  • Prev by Date: How to pick user selected files only from one folder?
  • Next by Date: Line feed, paragraph or whatever in item of list
  • Previous by thread: How to pick user selected files only from one folder?
  • Next by thread: Re: How to pick user selected files only from one folder?
  • Index(es):
    • Date
    • Thread