Skip to main content
Known Participant
January 21, 2021
Question

Dialog-based frame script

  • January 21, 2021
  • 1 reply
  • 1768 views

I decided I needed to have frames on my photographs before uploading them to my web site.  So, I found a frame action, and figured out how to adjust it for my needs.  But then I found that actions are far too inflexible and far too hard to edit.  So, I learned how to use JavaScript, and created a dialog-based framing script.  A sample can be seen here.  The script files and documentation can be downloaded from GitHub.

 

If you find a problem or if you would like to see an improvement, let me know here or post an issue in GitHub.

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
January 21, 2021

Your readme

 

# Frame-With-UI

A PhotoShop action can be handy, but it is severely limited.  Most choices are pre-made.  If any choices can be made as the action is running, they can only be made one at a time.  There is no way to save choices for future use.  Editing actions is an extremely cumbersome process.

PhotoShop has the ability to run scripts written in JavaScript, and those scripts can have dialog boxes in which users can make selections before the script begins applying choices to the image.  The Frame With UI (user interface) script is an example.  All parameters of the frame can be selected before the frame is generated.  If you don't like how the frame looks, you can click "Reset Frame" to restore the image to its original appearance.  Frame styles can be saved, and previosly saved styles can be loaded.  

To install this script, extract the files from the zip file into a location of your choice.  To use the script, select File | Scripts ! Browse... and select FrameWithUI.jsx.  You don't need to install them into your PhotoShop folder, but it may make it easier for PhotoShop to find it or remember it if you do.  On my computer, that folder is C:/Program Files/Adobe/Adobe PhotoShop 2021/Presets/Scripts.  To use the script in PhotoShop, select File | Scripts | Browse... and select the FrameWithUI.jsx file.  

It is possible that saving frame styles may require you to make the Scripts folder writable by all users of your computer.  The XML file that stores the styles gets written into that folder.  Because I made my folder writable early in the process of developing this script, I do not yet know if the script will run with that folder having its default security settings.

Detailed documentation can be found in the zip file (once I write it).

 

However on mt Windows 10 PS 22.1.1 PS 2021 thet is nos sucj script and neither of the two jsx script open a dialog??

JJMack
Known Participant
January 22, 2021

Thank you for pointing out that the readme file needs to be updated.  I have removed the zip file from the GitHub archive and replaced it with individual files.  You will need to copy the .js and .jsx files into the PhotoShop scripts folder yourself.  You may need to change permissions on that folder to do so.  Also, the GitHub repository now includes a detailed documentation file.  

JJMack
Community Expert
Community Expert
January 24, 2021

JJ,

 

There's another problem with not having the frame script in the main PhotoShop scripts folder:  I haven't found a good way to configure shortcut keys for it.  If it is the main scripts folder, it will appear in the dropdown list of available scripts, and you can use the standard keyboard shortcuts tool to assign a shortcut for it.  If you don't want it in the main scripts folder, the other option is to create an action to invoke the script.  The problem here is that the result of an action doesn't appear until the action is finished running.  One of my goals in developing the frame script was to be able to see the script before the dialog closes, so you can tell if anything needs to be changed and then make the change immediately.  You can't do that if the script is called from an action.

 

Rob


As I wrote when I copied your files into Photoshop 22.1.1 Presets\Scrpts and start Photoshop your scripts FrameDialog.jsx  FrameStylesDialog.jsx fail to show a dialog. My User access would also not have write access to the Presets Scripts folder:

"C:\Program Files\Adobe\Adobe Photoshop 2021\Presets\Scripts"

 

I now see a new script you have now add  today FrameWithUI.jsx . So I create a folder in my scripts tree and downloaded you file one at a time into it . That script FrameWithUI.jsx does open a Dialog.

JJMack