Skip to main content
Known Participant
December 14, 2022
Answered

Execution of the app.executeMenuCommand ('AI Place'}) process

  • December 14, 2022
  • 3 replies
  • 796 views

How do I force a script to stop executing commands while waiting for the "app.executeMenuCommand ('AI Place')" command to finish?

This topic has been closed for replies.
Correct answer pixxxelschubser

something like that:

var aFile = File.openDialog ();
var aPlaced = app.activeDocument.placedItems.add();
aPlaced.file = aFile;

3 replies

pixxxelschubser
Community Expert
Community Expert
December 14, 2022

😄

alert("Click me when you're done!")
Known Participant
December 14, 2022

a warning window (!) appears before you specify where to insert the file.

CarlosCanto
Community Expert
Community Expert
December 14, 2022

you might not be able to do that, you could either use placedItems.add() then feed a file or if your file changes everytime you run your script, have the script prompt you to select a file via selectDlg

Known Participant
December 14, 2022

Thanks CarlosCanto!

Using File.openDialog, I got the path to the desired file.
but...
I can't figure out how to bind the path and name to the "placedItems" I created.

pixxxelschubser
Community Expert
pixxxelschubserCommunity ExpertCorrect answer
Community Expert
December 14, 2022

something like that:

var aFile = File.openDialog ();
var aPlaced = app.activeDocument.placedItems.add();
aPlaced.file = aFile;
Charu Rajput
Community Expert
Community Expert
December 14, 2022

Hi @Dmitriy27445167miri 

What is the purpose of doing this?

You mean you want to cancel this operation after selecting the file?

Best regards