Re: Just returning Filename... not whole path
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