I have some data files in the same folder as my script. Is there a way to get the full path of one of them, named data.txt for example?
I assume you mean the folder where the script lives will change so you can’t hard-code it into your script?
There’s a command called “Path to me” that returns the path to your script, but you have to save it as an application or you’ll get the path to script editor. Once you have the path to your script, you can get the folder name by asking for the container of the path and add-on the file name.
set thePath2Me to path to me
tell application “Finder”
set theFolderOfMe to container of thePath2Me
end tell
set theFolderOfMe to theFolderOfMe as string
set thePath to theFolderOfMe & “data.txt”