Pass Folder name (not path) to Applescript

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

When a folder reaches a certain number of files, I want to trigger an applescript to send an email. Here is my Applescript:

Code: Select all
tell application "Mail"
   set theNewMessage to make new outgoing message with properties {subject:" 10 items " & theFile & , content:"" & theFile & "", visible:true}
   tell theNewMessage
      make new to recipient at end of to recipients with properties {address:"XXX@XX.com"}
      send
   end tell
end tell


It is working perfectly, but theFile returns a full path HD:Users:Dad:TARGETFOLDER etc...

I want it to pass only the TARGETFOLDER to the Applescript.

If I want to display a notification, it works perfectly with this setup:

-Display notification with pattern (file)

Any help/workarounds?
miketheteacher
 
Posts: 8
Joined: Wed Jun 26, 2013 1:53 am

Just google around for this. It seems most of the solutions involve Finder though.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support