• 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
Re: Just returning Filename... not whole path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Just returning Filename... not whole path


  • Subject: Re: Just returning Filename... not whole path
  • From: Eric C Saunders <email@hidden>
  • Date: Mon, 24 Oct 2005 08:40:15 -0400



From Brett Conlon on 10/23/2005 at 08:15:33 PM:


> --ASK TITLE

> on AskTitle(aFile)
>         tell application "Finder" to activate
>         repeat

<snip>

>         end repeat
> end AskTitle
>
> THE ERROR:

>
> Can't get name of alias "...PATH TO FILE.PDF"


I believe you need Finder to get the name. When you wrote "tell application "Finder" to activate", it is the same as :
tell application "Finder"
        activate
end tell
so I think you can solve your error by replacing "tell application "Finder" to activate with:

tell application "Finder"
   activate

        repeat
                set d to display dialog "Please enter the Title name (less than 13 chrs) for the file " & (name of 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 repeat

end tell

every command that needs an application to function has to be inside a tell block targeting that application.


 
> Coj

>
> Brett Conlon/HU/AU/SonyDADC <email@hidden>  

>

Eric
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service._______________________________________________________________

This electronic message contains information from MeadWestvaco
Corporation or subsidiary companies, which may be confidential,
privileged or otherwise protected from disclosure. The
information is intended to be used solely by the recipient(s)
named. If you are not an intended recipient, be aware that
any review, disclosure, copying, distribution or use of this
transmission or its contents is prohibited. If you have
received this transmission in error, please notify MeadWestvaco
immediately at email@hidden.
_______________________________________________________________________
 _______________________________________________
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: Brett Conlon/HU/AU/SonyDADC <email@hidden>
    • Re: Just returning Filename... not whole path
      • From: "Gary (Lists)" <email@hidden>
References: 
 >Re: Just returning Filename... not whole path (From: Brett Conlon/HU/AU/SonyDADC <email@hidden>)

  • Prev by Date: [appscript] looking for feedback
  • Next by Date: Re: Do Shell Script
  • Previous by thread: Re: Just returning Filename... not whole path
  • Next by thread: Re: Just returning Filename... not whole path
  • Index(es):
    • Date
    • Thread