Using Files From Folder For Applescript

Joined
Oct 31, 2011
Messages
2
Reaction score
0
Points
1
Hey,

I've created an applescript that runs an application if certain criteria are met on files when added to folder. if these criteria aren't met then it checks to see if the file is a folder itself and then runs the same criteria on that folder as well.

currently it works for the initial folder but does nothing on the following folder - this is mainly because i don't know how to properly reference the files in the 'new' folder.

Here is my script in .txt format - hopefully it is self explanatory. the application i'm trying to launch is flicks and the file types are avi and mkv

View attachment Untitled.txt
 
OP
T
Joined
Oct 31, 2011
Messages
2
Reaction score
0
Points
1
I had another idea:

as the script works well for files in the parent folder can i do a simple script swell as that one to extract files from subfolders (when added) and move to parent folder

thus the second script will be innacted and hey presto it does the same thing.

my thought was:

on adding folder items to thisFolder after receiving addedItems
repeat with addedItem in addedItems
tell application "Finder"
if addedItem is "folder" then
set thedata to entire contents of folder "addedItem"
repeat with aItem in thedata
if class of aItem is not folder then
move aItem to folder thisFolder
end if
end repeat
end if
end tell
end repeat

end adding folder items to
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top