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 26, 2021

What operating system are you using?  I've never seen the ~ character in a file or folder name before.  A quick Google search told me that the ~ character refers to a user's home directory in Unix/Linux systems, which should also include Macs, since Apple operating systems are based on Unix.  I don't know if it's available on Windows systems.  In Windows, I should be able to use %APPDATA% or %LOCALAPPDATA%.  I haven't played with it yet, though.

 

Thanks again for your help!

 

Rob


There are special file coding conversion in Adobe Photoshop scripting documentation. There are special name constants to make coding between the two platform easier to do be platform independent.  I believe it in the  "JavaScript-Tools-Guide-CC.pdf" .  Where Script UI is also documented. I only hack at Photoshop Scripting. I do not know JavaScript and can't touch type.   I know thing like URI file coding exists and the are many file encoding standards.  Much of the code in my scripts is cut and pasted and massage code,  I can hack I can not type. From code I have seen or documentation I have read I may  know  I can use Folder.temp  in a path and that will access a  file in a users system temp on either platform.  I also know the are system environment variable  like %PATH% you can use.  What I use may depend more on whose code I copied from.   "Application Data" may be an alias for %APPDATA% on windows and a alias on a Mac  for whatever.    I may also be able to use Folder.appdata for all I know.  Sometime I may just try something I think  may work. Sometimes I get lucky. I'm 80 I have forgotten more than I ever knew.

 

 

 

 

 

JJMack