Re: Just returning Filename... not whole path
Re: Just returning Filename... not whole path
- Subject: Re: Just returning Filename... not whole path
- From: Yvan KOENIG <email@hidden>
- Date: Mon, 24 Oct 2005 08:10:55 +0200
Le 24 oct. 2005 , à 2:15, Brett Conlon/HU/AU/SonyDADC a écrit :
Any takers? <8-}
The code so far (or the bits you need to see):
on open (filelist)
if GetResources() is true then
CreateNewFolder()
GetResources()
repeat with aFile in filelist
with timeout of (5 * minutes) seconds
set replacement_title to
AskTitle(aFile)
set replacement_catNo to AskCatNo()
DoAllThis(aFile)
ReplaceTitle(replacement_title)
ReplaceCatNo(replacement_catNo)
end timeout
end repeat
end if
InClosing()
end open
--ASK TITLE
on AskTitle(aFile)
tell application "Finder" to 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 AskTitle
THE ERROR:
Can't get name of alias "...PATH TO FILE.PDF"
Coj
Hello
It seems that I already responded (even adding that your code failed to
check that the entered name was really less than 13 chars long.
De: email@hidden
Objet: Rép : Just returning Filename... not whole path
Date: 21 octobre 2005 7:00:37 GMT+02:00
À: email@hidden
Here is your late version with some corrections in the AskTitle handler.
Your
tell application "Finder" to activate
instruction contains an "implicit " end tell so the Finder is unable to
deal with the
set d to display dialog "Please enter the Title name (less than 13
chrs) for the file " & (name of aFile) & ":" default answer ""
instruction.
As I don't know which is the nature of the variable aFile in your
open(filelist) handler I assume that it is an alias.
property a_File : "Macintosh HD:Users:yvankoenig:Desktop:Image 4.pdf"
set aFile to a_File as alias
set replacement_title to AskTitle(aFile)
on open (filelist)
if GetResources() is true then
CreateNewFolder()
GetResources()
repeat with aFile in filelist
with timeout of (5 * minutes) seconds
set replacement_title to AskTitle(aFile)
set replacement_catNo to AskCatNo()
DoAllThis(aFile)
ReplaceTitle(replacement_title)
ReplaceCatNo(replacement_catNo)
end timeout
end repeat
end if
InClosing()
end open
--ASK TITLE
on AskTitle(aFile)
-- tell application "Finder" to activate
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
end AskTitle
Yvan KOENIG
_______________________________________________
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