Saturday, December 16, 2017

#1 2017-08-14 09:01:17 am

psepulvida
Member
Registered: 2017-08-10
Posts: 3

Input a reference, search for this and place in InDesign script

Hello!

Im trying to make a script with the follow coordinates.

- User input an info.
- Script search for an image with this info.
- After, place in inDesign this image.

I don't know what is wrong in my script, but his return this information.

error "Can’t get alias \input info\" of alias \"path that indesign search for the input info\"." number -1728

This is my script.

Applescript:


set originalFolderPath to choose folder with prompt "Please locate the folder"
tell application "Adobe InDesign CC 2017"
   set myDialog to make dialog
   tell myDialog
       set name to "Test"
       set myDialogColumn to make dialog column
       tell myDialogColumn
           set myBorderPanel to make border panel
           tell myBorderPanel
               set myDialogColumn to make dialog column
               tell myDialogColumn
                   make static text with properties {static label:"Reference:"}
               end tell
               set myDialogColumn to make dialog column
               tell myDialogColumn
                   set myTextEditField to make text editbox with properties {edit contents:"", min width:180}
               end tell
           end tell
       end tell
   end tell
   set myResult to show myDialog
   if myResult is true then
       tell application "Adobe InDesign CC 2017"
           set myNameFile to edit contents of myTextEditField
           set myDocument to active document
               tell myDocument
               set noColor to swatch "None"
               set myRectangle to make rectangle with properties {fill color:noColor, stroke color:noColor, geometric bounds:{0, 0, 10, 10}}
               tell myRectangle
                   place alias (myNameFile) of originalFolderPath on myRectangle
               end tell
               fit myRectangle given proportionally
               fit myRectangle given center content
           end tell
       end tell
   end if
   destroy myDialog
end tell


Filed under: indesign script

Offline

 

#2 2017-08-14 11:23:58 am

Marc Anthony
Member
From:: Dallas, TX
Registered: 2006-04-27
Posts: 772

Re: Input a reference, search for this and place in InDesign script

Your place command is incorrectly looking for the alias of an alias. An alias can't be concatenated, without first being coerced to text. This would work, assuming your file is at the expected location; an alias can only point to an extant object.

Applescript:

place alias (((originalFolderPath as text) & myNameFile)) on myRectangle

Offline

 

#3 2017-08-14 12:09:41 pm

psepulvida
Member
Registered: 2017-08-10
Posts: 3

Re: Input a reference, search for this and place in InDesign script

Thanks! But a got a syntax error:

Expected “,” but found application constant or consideration.

What is this?

Offline

 

#4 2017-08-14 05:48:29 pm

Marc Anthony
Member
From:: Dallas, TX
Registered: 2006-04-27
Posts: 772

Re: Input a reference, search for this and place in InDesign script

I see no reason for that error with my suggestion. If you changed nothing else, it's possible your version is unhappy with the double document reference that precedes your if consideration. I would advise getting rid of the second "tell application" line and its corresponding "end tell".

Last edited by Marc Anthony (2017-08-14 05:50:10 pm)

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)