5 Replies Latest reply on Dec 17, 2014 9:26 AM by AS Scripter

    AS how to call place-dialog with predefined path?

    DBLjan Level 2

      Hi there,

       

      im frequently using 3 paths to get pictures and logos to place, so I asked a while ago how to script that, and got this answer:

       

      #target Indesign

      try{

      var pathToPredefinedFolder = Folder('/Volumes/Server1/Folder1/');//Folderobject

      app.place(pathToPredefinedFolder.openDlg ('Get some files', '', true)) //prompt, filter, multiselect

      }catch (e){}

       

       

      Problem is, im not familiar with JS, and cant modify to my needs. I managed to change the path thou. But:

      I need a little help how to get this done by AppleScript.

       

      Thanks ahead,

      Jan

        • 1. Re: AS how to call place-dialog with predefined path?
          AS Scripter Level 1

          set sourceFolder1 to "HD:images1:"

          set sourceFolder2 to "HD:images2:"

          set sourceFolder3 to "HD:images3:"

           

           

          tell application "Adobe InDesign CS6"

            tell document 1

            tell page 1

            set filePathToPlace1 to (sourceFolder1 & "1.tif") as string

            tell rectangle 1

            place file filePathToPlace1

            end tell

            set filePathToPlace2 to (sourceFolder2 & "2.tif") as string

            tell rectangle 2

            place file filePathToPlace2

            end tell

            set filePathToPlace3 to (sourceFolder3 & "3.tif") as string

            tell rectangle 3

            place file filePathToPlace3

            end tell

            end tell

            end tell

          end tell


          • 2. Re: AS how to call place-dialog with predefined path?
            DBLjan Level 2

            Thank you, but i need that place-dialog. Guess i'm gonna have to invoke the menu.

             

            I thought there must be a function for this, since JS does simple things like .place .openDlg


            • 3. Re: AS how to call place-dialog with predefined path?
              AS Scripter Level 1

              -- one rectangle is selected

              tell application "Adobe InDesign CS6"

                activate

                tell document 1

                set theRect to object reference of selection

                end tell

              end tell

               

              tell application "Finder"

                activate

                set fp to (choose file) as string -- "fp" = full path of file

               

              end tell

               

              tell application "Adobe InDesign CS6"

                activate

                tell theRect

                place file fp

                end tell

              end tell

              • 4. Re: AS how to call place-dialog with predefined path?
                DBLjan Level 2

                Meh. I thank you for your commitment, but it too limited, having to have a box selected, not beeing to multiselect files to place, also cant access optional import-options…

                 

                Or maybe someone can enhance the JavaScript to following intent:

                I want to save time, because I always press command+f to get into the search.
                My idea was, to add something like …

                tell application "System Events"

                        activate application "Adobe InDesign CS5.5"

                        keystroke "f" using {command down}

                end tell

                but I cant do this in JS…maybe someone can help?

                • 5. Re: AS how to call place-dialog with predefined path?
                  AS Scripter Level 1

                  set fd to (alias "HD:images:HiRes:") -- default folder of following choose file dialog

                  set fp to (choose file with prompt "Select some files" default location fd with multiple selections allowed) -- returns a list of aliases