Applescript question

Discussion in 'Mac Programming' started by roontoon, Sep 28, 2010.

  1. macrumors newbie

    Joined:
    Sep 28, 2010
    #1
    Hi,

    I have the following code:


    tell application "Mail"
    set theMessage to make new outgoing message with properties {visible:true, subject:"Boxee Show Notification", content:"A new episode of your show " & theFile & " has arrived", sender:"bitbucket"}
    tell theMessage
    make new to recipient at end of to recipients with properties {name:"dkamp", address:"dk@yada.com"}
    make new to recipient at end of to recipients with properties {name:"CobbleCat", address:"Ca@yada.rr.com"}
    end tell
    send theMessage
    end tell

    This is being used inside of Hazel to notify me when a download has been completed. The problem I am having is on this line:

    "A new episode of your show " & theFile & " has arrived" The file in question is the current one that Hazel is acting on BUT it delivers the entire path along with the file name. The question is how do I trim off the path so only the file name is left. I am OK with the file extension but I would really like to lose the path. Please educate me.

    Thanks in advance. :apple::apple:

    d
     

Share This Page