Hey guys ok here it is, I have a script which opens a IMDL file in indesign. Indesign opens these files as “Untitled” new documents. the rest of the script makes a brand new document then i want to save it with the name of the original IMDL name. But somethings wrong, the ‘name’ isnt being captured.
Any help will make my life easier!
-------------------------- CODE------------------------
tell application "Adobe InDesign CC 2015"
(*set JobDestination to choose folder with prompt " Choose Destination Folder"*)
--------------open imdl---------------
set imdlFile to choose file with prompt "Open IMDL File"
open imdlFile
(* copy the name of active document to {JobName}*)
----------------Doc Set up----------------
set myDocument to make document
tell view preferences of myDocument
set show frame edges to false
set vertical measurement units to inches
set horizontal measurement units to inches
end tell
tell document preferences of myDocument
set page width to 8.5
set page height to 11
set facing pages to true
set page orientation to portrait
set document bleed top offset to 0
set document bleed uniform size to true
end tell
tell margin preferences
set top to 0.25
set left to 0.25
set bottom to 0.25
set right to 0.25
end tell
tell active document
----------------Make layers----------------
set SubLayer to make layer with properties {name:"Sublayer"}
set BackgroundLayer to make layer with properties {name:"Background"}
set EditableLayer to make layer with properties {name:"Editable"}
tell layer 4
delete
end tell
-------------- Make second page----------------
make page at after page 1
set active layer to layer "Background"
-----save file---------
(* save to JobDestination & JobName *)
save
end tell
end tell