Object layer visibility - Applescript
Hi,
I am trying to write a script to change the object layer visibility in my documents. I get an error -1708. Does anyone can help me please.
this is my script
tell application "Adobe InDesign CS5.5"
activate
if active book exists then
else
set GetParentPath to ((choose file with prompt "Kies een Indesignbook:" of type "IDb5.5"))
open GetParentPath
delay 1
end if
end tell
tell application "Adobe InDesign CS5.5"
tell active book
set fileList to full name of book contents
end tell
--general
set CountryArray to {"BE", "FR", "NL", "EX", "DE", "NO"}
set CountryID to choose from list CountryArray with prompt "Selecteer de juiste catalogus prijzen." OK button name "Update book" without multiple selections allowed
--make all layers visible
repeat with aFile in fileList
set theDoc to open aFile
set myDocument to active document
tell myDocument
set layers's visible to true
set var_linkcount to count of links
repeat with j from 1 to var_linkcount
tell graphic layer options of parent of link j
try
set graphic layers's visible to true
if CountryID is false then return
set Country to characters 1 thru 2 of item 1 of CountryID as string
set ActiveLayerOption to (Country & " prices")
set DeactivateLayerOption to {}
repeat with x from 1 to count of CountryArray
set i to item x of CountryArray as string
if i is Country then
else
set thisLayer to (i & " prices")
try
set visible of graphic layer thisLayer to false
end try
end if
end repeat
end try
end tell
end repeat
end tell
close theDoc saving yes
end repeat
display dialog "Layers zijn aangepast"
end tell