Saturday, January 20, 2018

#1 2003-07-02 11:59:24 am

julifos
Administrator
From:: Malasaña, Madrid
Registered: 2002-11-20
Posts: 2014

Process recursivelly dropped files/folders

You can use this set of handlers to process any files/folders dropped into your droplet, which will search recursivelly every file and apply your code.
It is very fast, since it doesn't use the "info for" command to determine if the item is a folder or file.

OS version: Any

Applescript:

on open aliasList
   repeat with i in aliasList
       processUnknownItem(i)
   end repeat
end open

to processUnknownItem(thisItem)
   if (thisItem as text) ends with ":" then
       processFolder(thisItem)
   else
       processFile(thisItem)
   end if
end processUnknownItem

to processFolder(thisFolder)
   --> you can manipulate this folder adding code here
   set itemList to list folder thisFolder without invisibles
   repeat with i in itemList
       processUnknownItem(alias ((thisFolder as text) & i))
   end repeat
end processFolder

to processFile(thisFile)
   --> you can manipulate this file adding code here
end processFile

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)