Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Any AppleScript geniuses? referring to folders in folders
#1
i'm trying to write an applescript that organizes files in a hierarchy of folders. unfortunately i'm having trouble getting the subfolder of an existing folder.

the following code fails to find the folder "test" inside of thisFolder - because i'm doing something wrong.

ideas?

---

on adding folder items to thisFolder after receiving addedItems
tell finder
if exists folder "test" of thisFolder then
display dialog "yes"
else
display dialog "no"
end if
end tell
end adding folder items to
Reply
#2
You can get subfolders by naming them, specifically, or by using "entire contents" to target them, en masse:

if exists folder "test" of thisFolder's entire contents then
Reply
#3
I'm guessing that's not your actual script... it wouldn't compile.

Try using the absolute path.

if exists "drive:folder:folder2Confusedubfolder" then
Reply
#4
I didn't notice it on my initial inspection of your code, but the Finder directive needs to read:

tell application "Finder"
Reply
#5
yeah, i think that was the problem, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)