I'm writing a script that will (hopefully) go through a folder and subfolders and make a list of the paths of the files it finds. That part is for another day though.
Right now, I'm working on this part. I don't need the whole path. I want to only include the last part of the file path.
FOR EXAMPLE:
/Users/Scav/Test/Content/ReadMe's/pics/11361.jpg
I only want Content/ReadMe's/pics/11361.jpg
I've written this
Which does what I want. BUT, can this be done without the kludgy "Content/" & (text item 2 of xpath) part?
Right now, I'm working on this part. I don't need the whole path. I want to only include the last part of the file path.
FOR EXAMPLE:
/Users/Scav/Test/Content/ReadMe's/pics/11361.jpg
I only want Content/ReadMe's/pics/11361.jpg
I've written this
Code:
tell application "Finder"
set xfile to choose file
set xpath to POSIX path of xfile
set AppleScript's text item delimiters to "Content/"
set newpath to ("Content/" & (text item 2 of xpath))
end tell
Which does what I want. BUT, can this be done without the kludgy "Content/" & (text item 2 of xpath) part?