To preface: My Applescript takes an Excel file, and copies its data into a new plain text file.
I am having trouble writing the new text file in the same location as my existing Excel file, but without the filename of the original file.
For example: My Excel file is "FilenameA.xls" and when I save my new text file, it saves it as "FilenameA.xlsFilenameB.txt"
How can I save this new file to the same location, but with my own filename?
NOTE: It works when I use (path to desktop as text)
but I won't always be saving these to my desktop.
set myFile to open for access (path to desktop as text) & blahBlah & ".txt" with write permission
When I try the script below, it gives me the original filename PLUS my new file name.
set myFile to open for access (fileName) & blahBlah & ".txt" with write permission
NOTE: fileName
refers to the path of the original Excel file.
Essentially I want the same results as (path to desktop as text)
but with the flexibility of saving the file to whatever folder in which the original was accessed.