creating proper file names

I am trying to write a script for PDFmerge (I don’t think it is necessary to really know that app to answer this) and I cannot get the file path I want created to go to the right place. I created a variable that contains the disk and path and try to concatenate it with a filename created in the script. Instead of putting the file on the expected disk it creates a new folder on the boot disk with that path name. Syntax for path names in Apple script are a black magic I have not yet learned.


set pdf_folder to "USER1:Common:converts"
.
.
.
merge to pdf_folder & ":" & file_name & ".pdf"

Instead of putting the file in “USER1:Common:converts”, it puts it in “Macintosh HD:USER1:Common:converts” Would someone give me the correct syntax for getting it in the right place? TIA.

gw1500se,

I’m not sure but it may have to do with whether you are setting your folder reference in a “tell app “Finder”” block or not. At least I have had problems with file/folder paths if they were not in Finder tell blocks.

PreTech

Model: G5 dual 1.8
AppleScript: 2.1
Browser: Safari 125.12
Operating System: Mac OS X (10.4)

The choose folder command helps me often when trying to figure out how to describe a path to a folder. In the Script Editor put

set pdf_folder to choose folder

Selecting the Result button from the Description/Result/Event Log buttons at the bottom of the Script Editor window and then running the script will present a folder selection dialog. After a folder is selected, the path to the selected folder is shown in the pane below your script.

I have a drive named Boost and the path to a folder on that partition is “Boost:Documents:”.

Craig