• 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: Is this valid "whose" syntax for folder actions file extension filtering?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this valid "whose" syntax for folder actions file extension filtering?


  • Subject: Re: Is this valid "whose" syntax for folder actions file extension filtering?
  • From: "Stockly, Ed" <email@hidden>
  • Date: Tue, 09 Feb 2010 16:35:20 -0800
  • Thread-topic: Is this valid "whose" syntax for folder actions file extension filtering?

Title: Re: Is this valid "whose" syntax for folder actions file extension filtering?
Whoops, hit send too soon!

Here’s how I would do this:

on
adding folder items to thisFolder after receiving someItems
   
    
set
jpgsFromSomeItems to {}
    
repeat with
thisItem in someItems
       tell application "Finder"
            
if the
name extension of thisItem is "jpg" then
               set the end of
jpgsFromSomeItems to thisItem as alias
           end if
       end tell
   end repeat
   repeat with
myItem in (jpgsFromSomeItems)
        --
do your stuff here
   end repeat
   return
jpgsFromSomeItems
end adding folder items to


>>>Is this the proper way to do it in a whose statement?  

No, whose commands won’t work on a list.  You can use them on Finder items like folders or discs.

    every file of myFolder whose name extension is “jpg”



----Also, how is the programmer able to see debug output or errors from folder action scripts?

In the Script Editor open the Event Log window.  You can access it from the Window menu or via the buttons at the bottom of your script window.


Using that you can include a log command in your script to view a particular item:

log someItems
log every file of folder myFolder

You can also display the script’s result.

HTH,

ES
 
 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

References: 
 >Is this valid "whose" syntax for folder actions file extension filtering? (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Is this valid "whose" syntax for folder actions file extension filtering?
  • Next by Date: Re: Coercing an array of aliases to files
  • Previous by thread: Re: Is this valid "whose" syntax for folder actions file extension filtering?
  • Next by thread: Coercing an array of aliases to files
  • Index(es):
    • Date
    • Thread