I have a need to grab only the file name portion of an alias list which I have obtained from a folder containing numerous eps files. I will then apply each file name to a series of Quark documents so that I can input each eps into its own, named document. The only part I am having difficulty with is grabbing the file name portion so that I can set a variable to it. I have tried all sorts of attempts at creating the list as an alias list and as a string etc etc. Nothing I have tried gives me precisely what I need. I either get the full alias path containing the file name or some error. Any ideas ??? thanks in advance
: I have a need to grab only the file name portion of an alias list
: which I have obtained from a folder containing numerous eps
: files. I will then apply each file name to a series of Quark
: documents so that I can input each eps into its own, named
: document. The only part I am having difficulty with is
: grabbing the file name portion so that I can set a variable to
: it. I have tried all sorts of attempts at creating the list as
: an alias list and as a string etc etc. Nothing I have tried
: gives me precisely what I need. I either get the full alias
: path containing the file name or some error. Any ideas ???
: thanks in advance
This may help:
on FileOfPath(thePath, theFile)
repeat with char from length of thePath to 1 by -1
if character char of thePath is ":" then exit repeat
end repeat
set theFile to characters (char + 1) thru (length of thePath) of thePath
end FileOfPath
: I have a need to grab only the file name portion of an alias list
: which I have obtained from a folder containing numerous eps
: files. I will then apply each file name to a series of Quark
: documents so that I can input each eps into its own, named
: document. The only part I am having difficulty with is
: grabbing the file name portion so that I can set a variable to
: it. I have tried all sorts of attempts at creating the list as
: an alias list and as a string etc etc. Nothing I have tried
: gives me precisely what I need. I either get the full alias
: path containing the file name or some error. Any ideas ???
: thanks in advance
There is also this one wich is in Applescript Examples
jean-Baptiste LE STANG
on extract_filename_from(this_filepath)
set this_filepath to this_filepath as text
set x to the offset of ":" in (the reverse of every character of this_filepath) as string
return ((characters -(x - 1) thru -1 of this_filepath) as text)
end extract_filename_from
There are several simple ways of getting what you want. You might try this for a startÉ…
(info for (fileAsAlias as string))'s name
Andreas
You’re very welcome - and thank you for bothering to say thankyou!
Andreas
Hey Andreas and Jean-Baptiste, you guys are great. You gave me enough info to continue on—thanks, thanks, thanks