Changing application after reopening script

I have a script that ‘talks’ with Indesign CC 2017.
something like:

set pINDDAppID to "com.adobe.InDesign"

using terms from application "Adobe InDesign CC 2017"
	tell application id pINDDAppID
		get name of document 1
		
	end tell
end using terms from

after saving it and reopening it auto change to:
using terms from application "Finder"
every time.

I need to use using terms from application “Adobe InDesign CC 2017” in certain circumstances because otherwise certain InDesign commands are not recognised.

It’s something that’s only happening in SD6 i never had the problem in the previous version of SD.

I never needed the «use terms from…» command with Indesign.

Try with:

tell application id "InDn"
    get name of active document
end

It sounds like you accidentally chose Finder in the missing application dialog at some stage.

Open ~/library/preferences/com.apple.applescript and delete the entries for ApplicationMap.

Just checked that plist but no indication in it of a ApplicationMap just color settings.
The suggestion of Jonas sometimes work and in other circumstances I really should add teh using clause… see screenshot

What’s in your sInDnLib?
I mean: what’s your code to get the Indesign ID?

And in the setJPEGExportPrefs handler, is the JPEG export range property set correctly?

Try this script on a test document and let us know if it works.

tell application id "InDn"
	tell JPEG export preferences
		set JPEG export range to export all
		set JPEG Quality to high
		set JPEG Rendering style to baseline encoding
		set export resolution to 72
	end tell
	export active document to (("" & (path to desktop)) & "test.jpg") format JPG without showing options
end tell

Thnx Jonas,
The issue seems to be that you can’t assign the application ID as a property or a variable and that’s what I’m doing.

But why the using terms is still chnaging to “Finder” remains a mistery. The idea of Shane wasn’t applicable. It’s something that only happens with InDesign CC 2017 and a imported qcriptlibrary in which I have all the common code for InDesignCC 2017.