Plan:
I am trying to create a template to build real estate flyers from.
Execution:
- I use dialog boxes to capture the information to put in the template
- I have an InDesign file with text boxes, each containing a script label
- I call the script label (i.e. “MLSLabel” and search and replace the default text with the text gathered from the dialog box ansr1 and “Mapsco Coordinate” and search and replace the default text with the text gathered from the dialog box ansr2, and so on)
Problem:
the script below puts the right text from ansr1 in the first text box, but then it puts the right answer from ansr2 in the first text box, replacing the previous action, and then in the second text box where it belongs.
tell application "Finder"
activate
open document file "Leave-Behind template.indd" of folder "*Listings" of folder "Cheryls Folder" of folder "File Storage" of startup disk
end tell
tell application "InDesign CS"
if exists document 1 then
tell document 1
set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set userInput1 to display dialog "8 digit MLS Number." default answer "Type Here"
set ansrA to text returned of userInput1
set theAnsr1 to ansrA
set ansr1 to first text item of theAnsr1
search "MLSLabel" for "12345678" replacing with ansr1
set userInput2 to display dialog "Mapsco coordinate" default answer "Type Here"
set ansrB to text returned of userInput2
set theAnsr2 to ansrB
set ansr2 to first text item of theAnsr2
search "MapscoLabel" for "000" replacing with ansr2
end tell
end if
end tell