Ok, let me make sure I understand what you’re doing. In a folder you have a .pdf file and .job file. You want to rename the .job file to the name of the .pdf file, both keeping their extensions(suffixes). Is this correct?
If I understood correctly, this can be done in the Finder. Something like this should work:
tell application "Finder"
set myFolder to folder "path:to:the:folder:"
tell myFolder
repeat with i from 1 to count files
if name extension of file i = "pdf" then
set pdfFile to file i
else if name extension of file i = "job" then
set jobFile to file i
end if
end repeat
set extension hidden of pdfFile to true
set extension hidden of jobFile to true
set pdfFileName to displayed name of pdfFile
set name of jobFile to pdfFileName & ".job"
end tell
end tell
finally i found out, where the problem lies. on my g4 i have os x 10.3.4 and if i want to hide the extension of a file, it doesn´t work. so i tried my ibook and there with the same system installed i can hide the extension but i get an error that the variable of jobFile in the script is not declared.
does anybody know something about the problem with the extension on 10.3.4?
tell application "Finder"
set myFolder to folder "path:to:the:folder:"
tell myFolder
repeat with i from 1 to count files
if name extension of file i = "pdf" then
set pdfFile to file i
else if name extension of file i = "job" then
set jobFile to file i
end if
end repeat
set pdfFileName to displayed name of pdfFile
if (offset of ".pdf" in pdfFileName) is greater than 0
set pdfFilename to (characters 1 thru ((offset of ".pdf" in pdfFileName) - 1) of pdfFileName) as string
end if
set name of jobFile to pdfFileName & ".job"
end tell
end tell