Script to Import Files
I've been getting a little bit into Premiere and After Effects scripting recently and now I'm interested in extending that application to Photoshop, but I'm not quite sure where to start. I'm trying to make a script that does the following:
Import a file (the directory and filename is hardcoded into the script) into my current active document AS A SMART OBJECT with the center of that imported file at a certain coordinate specified in the script. Furthermore, the smart object should be resized to have a height of 360 pixels while maintaining the same aspect ratio as the original file (so the width should be determined automatically by the script).
So for example, if I have a 1920x1080 resolution active document, then a png file that is 1080x1440 should be imported into my document. That png file should then be converted to a smart object and then resized to be 270x360 with the number 270 being determined by keeping the same aspect ratio from changing the height to 360. Finally, the center of the new smart object layer should then be relocated at 260 pixels horizontally and 810 pixels vertically in the document (260,810) after the previous transformations have been applied.
This script should be able to function regardless of the resolution of the imported file and should have no prompts. Once again, the name of the file (including the extension) should be hardcoded into the script.
I'm not sure how to get started with this. Can somebody please give me some example scripts that would perform something similar to this or at least point me in the right direction?
