Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 07, 2016, 06:28:30 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Javascript to pull images into InDesign - convert applescript?  (Read 1416 times)

schnarkle

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11
    • View Profile
    • Donate to Member
A colleague developed this applescript to import comics into a template as seen below and I've been reading up on Javascript trying to figure out how to convert this for use in our windows environment:

--This script will open an Adobe Indesign page for the Comics and flow all comics files for the selected date.
set displayString to "Please Enter Year"
set DYear to (year of (current date))
set response to display dialog displayString default answer DYear
set theNumber to (text returned of response) as number
set DYear to text returned of response
set displayString to "Please Enter Month"
set Dmonth to do shell script "date '+%m'"
set response to display dialog displayString default answer Dmonth
set theNumber to (text returned of response) as number
set Dmonth to text returned of response
set displayString to "Please Enter Day"
set Dday to (day of (current date)) + 1
set response to display dialog displayString default answer Dday
set theNumber to (text returned of response) as number
set Dday to text returned of response
tell application "Adobe InDesign CS4"
set comic1 to "macintosh Hd:users:marshall:documents:comics:" & DYear & Dmonth & Dday & "pzjud-a.tif"
set comic2 to "macintosh hd:users:marshall:documents:comics:fct" & DYear & Dmonth & Dday & ".tif"
set comic3 to "macintosh hd:users:marshall:documents:comics:det" & DYear & Dmonth & Dday & ".tif"
set comic4 to "Macintosh HD:users:marshall:documents:comics:bbt" & DYear & Dmonth & Dday & ".tif"
set comic5 to "Macintosh HD:users:marshall:documents:comics:blt" & DYear & Dmonth & Dday & ".tif"
set mydoc to open "Macintosh HD:users:marshall:documents:comix:GGDailyBlank.indd"
tell mydoc
tell page 1
set myrect1 to page item named "image1"
set myrect2 to page item named "image2"
set myrect3 to page item named "image3"
set myrect4 to page item named "image4"
set myrect5 to page item named "image5"
tell myrect1
set myGraphic to place (comic1 as string)
fit myrect1 given content to frame
end tell
tell myrect2
set myGraphic to place (comic2 as string)
fit myrect2 given content to frame
end tell
tell myrect3
set myGraphic to place (comic3 as string)
fit myrect3 given content to frame
end tell
tell myrect4
set myGraphic to place (comic4 as string)
fit myrect4 given content to frame
end tell
tell myrect5
set myGraphic to place (comic5 as string)
fit myrect5 given content to frame
end tell
end tell
end tell

-------------------------------------------------------

Any tips or ideas to help get me started with this?  Most of the tutorials I'm reading deal with text and not images...

Thanks for any help!

 

Doug