• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Just returning Filename... not whole path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Just returning Filename... not whole path


  • Subject: Just returning Filename... not whole path
  • From: Brett Conlon/HU/AU/SonyDADC <email@hidden>
  • Date: Fri, 21 Oct 2005 14:11:43 +1000


OK, almost there now...

In the prompt dialogue where it asks for the title name of the DVD, if I have dropped more than one file it gets confusing as to which file it's asking the title of so I'd like to add the filename in the dialogue.

The below snipets of my script highlight the bits I'm working on but at the moment the dialogue is showing the entire path of the file being worked on... not just the filename. How do I change it to just return the filename?

Here's the code:


on open filelist
        with timeout of (5 * minutes) seconds
                if GetResources() is true then
                        CreateNewFolder()
                        GetResources()
                        repeat with aFile in filelist
                                set replacement_title to AskTitle(aFile)
                                set replacement_catNo to AskCatNo()
                                DoAllThis(aFile)
                                ReplaceTitle(replacement_title)
                                ReplaceCatNo(replacement_catNo)
                        end repeat
                end if
        end timeout
        InClosing()
end open

--ASK TITLE
on AskTitle(aFile)
        tell me to activate
        repeat
                tell application "Finder"
                        set fileName to name of aFile
                        set d to display dialog "Please enter the Title name (less than 13 chrs) for the file " & aFile & ":" default answer ""
                        set answer to text returned of d
                        if the answer contains ":" then
                                beep
                                display dialog "A file or folder name cannot contain a colon (:). Please try again..." buttons {"OK"} default button 1
                        else if the answer contains "/" then
                                beep
                                display dialog "A file or folder name cannot contain a forward slash (/). Please try again..." buttons {"OK"} default button 1
                        else
                                return answer
                                exit repeat
                        end if
                end tell
        end repeat
end AskTitle

Your assistance is MOST appreciated!

Cheers,

Coj
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Just returning Filename... not whole path
      • From: Eric C Saunders <email@hidden>
    • Re: Just returning Filename... not whole path
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Re: Representable date range: experiment results
  • Next by Date: Re: Just returning Filename... not whole path
  • Previous by thread: Re: Change a folder to list view
  • Next by thread: Re: Just returning Filename... not whole path
  • Index(es):
    • Date
    • Thread