AppleScript InDesign script doesn't work from script menu
Them variable IDunit in this script, using the script editor, gives me the units inches but when run from the script menu, gives me zinc and if I ask for it as a string, it gives me «constant****zinc» (display dialog). How can I fix this so it works from the script menu?
tell application id "com.adobe.indesign"
tell active document
tell view preferences
set IDunit to horizontal measurement units as string
end tell
end tell
end tell
tell application id "com.adobe.photoshop"
tell settings
if IDunit is "points" then set ruler units to point units
if IDunit is "picas" then set ruler units to pica units
if IDunit is "inches" then set ruler units to inch units
if IDunit is "inches decimal" then set ruler units to inch units
if IDunit is "millimeters" then set ruler units to mm units
if IDunit is "centimeters" then set ruler units to cm units
if IDunit is "ciceros" then display dialog "ID units don't match PS units"
if IDunit is "agates" then display dialog "ID units don't match PS units"
if IDunit is "pixels" then set ruler units to pixel units
end tell
end tell
I'm currently running OS 12.2.1
Any explanation or fix would be greatly appreciated.
MacBook Pro (2020 and later)