Illustrator setting visible to false

You can see from my code that I have set visible of application process “Adobe Illustrator” to false. This works fine on small files when it can process them quickly, hiding Illustrator when processing. However, when faced with larger files, this process fails and Illustrator is activated and the open dialog shows, as does the opened file and the save… it just remains active?

Why does this work OK on small, quickly processed files and not on larger ones

Any ideas would be most welcome

Kind Regards

on processFiles()
if validFiles ≠{} then
tell application “System Events” to set visible of application process “Adobe Illustrator” to false

	repeat with theFile in validFiles
		tell application "Adobe Illustrator"
			activate
			set user interaction level to never interact
			repeat until the (count of documents) is 0
				close every document saving no
			end repeat
			
			open theFile without dialogs -- "without" dialogs currently not working
			
			my AnalyzeDocumentFonts()
			
			my AnalyzeDocumentLinks()
			
			my fileCheck(theFile)
			
			save current document in file fullPath as pdf with options {class:PDF save options, PDF preset:chosenPdfPreset}
			close current document saving no
			set user interaction level to interact with all
		end tell
	end repeat
end if

end processFiles

Hi there,

Does it make a difference if you remove activate from the section below?

Hi TecNik - many thanks for your input

I tried your suggestion and removed “activate” from the code. However, it still does the same thing… works fine on small files but faced with a large file i.e. 150MB it activates, shows the open and save dialogs ?