Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jamesvdm

macrumors regular
Original poster
Mar 28, 2011
149
2
Perth, Australia
I have two scripts to watch folders for files and open in a particular application.

Script 1 will grab files even if they're in a folder, but Script 2 won't!

Script 1

on adding folder items to thisFolder after receiving addedItems

repeat with movieFile in addedItems
tell application "iFlicks"
import movieFile with gui
end tell
end repeat

end adding folder items to


Script 2

on adding folder items to thisFolder after receiving addedItems

repeat with movieFile in addedItems
if name of (info for movieFile) ends with ".mkv" then
tell application "iFlicks"
import movieFile as QuickTime movie without gui
end tell
else if name of (info for movieFile) ends with ".avi" then
tell application "iFlicks"
import movieFile as Apple TV 2 video without gui
end tell
end if
end repeat

end adding folder items to


Can someone please point out what I'm doing wrong? Thanks!
 
Derp, I had the problem wrong, not the script. The first script would pass the folder to iFlicks, which could then grab the video file. The second script won't pass the folder because it's looking for an extension.
 
Derp, I had the problem wrong, not the script. The first script would pass the folder to iFlicks, which could then grab the video file. The second script won't pass the folder because it's looking for an extension.

Glad you found the problem!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.