Hi All,
I have few InDesign CS file of version 1 as well as version 2. My task to generate a program for its version controll message as Users double click or while opening through applescript program.
Or I need some extra options to develop it.
Regards,
Rajeev
Adobe has on its website a Forum for InDesign scripting. If you haven’t already done so, it might be a good place to post a message and find help.
Yes I post the same message there, but I didn’t get reply yet.
I also got a program from that site but, it is not running properly.
Error is:
InDesign can’t understand “Export” , see the code below:
tell application "InDesign CS"
if (count of documents) = 0 then
return
end if
set selection to {}
try
set thePath to file path of document 1 as string
on error
display dialog "You must save the document before exporting the stories."
return
end try
tell application "Finder"
set f to folder thePath
set theFolder to the container of (the container of f)
if folder "InCopy Documents" of theFolder exists then
set inCopyFolder to folder "InCopy Documents" of theFolder
else
set inCopyFolder to make new folder in theFolder with properties {name:"InCopy Documents"}
end if
end tell
set myExtension to ".incd"
set exportCount to 0
try
set myDocument to document 1
set allSpreads to every spread of myDocument
repeat with mySpread in allSpreads
set myStories to {}
set myFrames to every text frame of mySpread
repeat with theFrame in myFrames
if the label of theFrame does not start with "Folio" and the label of theFrame is not "no export" then
copy parent story of theFrame to end of myStories
end if
end repeat
if myStories is {} then
-- This spread contains no stories to export
else
repeat with myCounter from 1 to (count of items in myStories)
set myStory to item myCounter of myStories
set l to item link of myStory
if l is nothing or link type of l is not "InCopyStory" then
--Name each story using the story ID.
set myFileName to my getFilename(name of myDocument)
set myFileName to myFileName & "-" & id of myStory & myExtension
--Create the path to the export file.
set myFilePath to (inCopyFolder as string) & myFileName
tell myStory to export format InCopy to myFilePath without showing options
set exportCount to exportCount + 1
end if -- if not linked to an inCopy story
end repeat --myStoryCounter
end if
end repeat -- with each spread
on error myErrorMessage
--activate
display dialog myErrorMessage
end try
if modified of myDocument is true then
save myDocument
end if
display dialog "Exported " & exportCount & " story/stories to InCopy." giving up after 5
--close myDocument
end tell
on getFilename(s)
local theName
local theList
set theName to s
set text item delimiters to "."
set theList to text items in s
if (count of items in theList) > 1 then
set theName to first item of theList
end if
return theName
end getFilename
Regards
Rajeev