Script works in 10.9 but fails in 10.11

Could anyone help me with this one, I can’t see why this script works perfectly in 10.9 but fails in 10.11 - same version of Acrobat DC is running on both Macs.

set thefolder to choose folder with prompt "Source Folder?"
set targetFolder to (choose folder with prompt "Destination Folder?") as text

tell application "Finder" to set filelist to every item of entire contents of thefolder
repeat with myFile in filelist
	set {name:fileName, name extension:fileExtension} to myFile
	if name extension of myFile is "pdf" then
			set docNameToSaveTo to text 1 thru -5 of fileName & ".ps"
			set docToSavePath to targetFolder & docNameToSaveTo
			tell application "Adobe Acrobat"
				open file (myFile as text)
				save document 1 to file docToSavePath using PostScript Conversion --with embedded fonts, halftones and TrueType without binary, annotation, images and preview
				close document 1 saving no
			end tell
		on error errMsg number errNum
			display dialog "An error occurred: " & errNum & " - " & errMsg buttons {"Cancel", "OK"} default button "OK"
		end try
	end if
end repeat


try to pass only the HFS path without the file specifier

open (myFile as text)

And why do you get the name extension into a variable but never use it? :wink:

Thank you, in answer to your question - I have no idea! I found this and have been trying to tweak it to suit my needs, unfortunately thats as far as my script knowledge goes. Still lots to do on this one, but its working on 10.11 thanks to your input :slight_smile: