Compare file Name between InDD & PDF - APPLESCRIPT
Hi All,
How do we find out the different or unique file names between ".indd" and ".pdf" extensions.
My request is need to popup if any file name different between InDesign and PDF.

Thanks
SS
Hi All,
How do we find out the different or unique file names between ".indd" and ".pdf" extensions.
My request is need to popup if any file name different between InDesign and PDF.

Thanks
SS
This isn’t returning any files because the selected folder has 2 folders and no files:
set inddFiles to (files of folder this_folder whose name extension is "indd") --Collect inddFiles
To get the sub folder files you want to use:
every file of entire contents
Try this:
set IDNames to {}
tell application "Finder"
set this_folder to (choose folder with prompt "Choose the Source Folder") as string
set IDList to (every file of entire contents of folder this_folder whose name extension is "indd") as alias list
set PDFList to (every file of entire contents of folder this_folder whose name extension is "pdf") as alias list
--a list of the InDesign files with no extension
repeat with f in IDList
copy my getName(f) to end of IDNames
end repeat
--check the PDFList
repeat with x in PDFList
set n to my getName(x)
if n is not in IDNames then
display dialog n & " is not in the INDD folder"
end if
end repeat
end tell
--returns the file name with no extension
on getName(f)
tell application "Finder"
set n to name of f
set e to name extension of f
set c to (count of e) + 2
return text 1 thru -c of n
end tell
end getName
Or this version to get a list of the ID files that are not in the PDF folder:
set PDFNames to {}
set missingPDFs to {}
set m to ""
tell application "Finder"
set this_folder to (choose folder with prompt "Choose the Soure Folder") as string
set IDList to (every file of entire contents of folder this_folder whose name extension is "indd") as alias list
set PDFList to (every file of entire contents of folder this_folder whose name extension is "pdf") as alias list
--a list of the InDesign files with no extension
repeat with f in PDFList
copy my getName(f) to end of PDFNames
end repeat
--check the PDFList
repeat with x in IDList
set n to my getName(x)
if n is not in PDFNames then
copy n to end of missingPDFs
set m to m & n & return
end if
end repeat
display dialog "These files are not in the PDF folder:" & return & m
end tell
--returns the file name with no extension
on getName(f)
tell application "Finder"
set n to name of f --gets the name of the file including its extension
set e to name extension of f --gets the file’s extension
set c to (count of e) + 2
return text 1 thru -c of n
end tell
end getName
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.