Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Populating an HTML panel from folders

$
0
0

Hi, similarly to Chris_G_1975 a few posts down, I'm trying to populate my HTML panel with buttons, but in my case I'm trying to use the folder structure for the panel.

My problem is mainly with being unfamiliar with HTML and Javascript, I'm quite confident with Extendscript, but plain Javascript doesn't seem to have the File and Folder objects I'm familiar

 

So basically what I'd like to do is:

1. Get a list of folders in a folder "scripts" that resides in the panel's source path.

2. Check each folder name to see if it contains a prefix that indicates it contains a script (eg: "NS_ScriptName" starts with "NS_" so it's a valid script )

3. Create a button such that for each forlder NS_ScriptName, it uses NS_ScriptName.png as the icon, NS_ScriptName.jsx as the script it executes and the contents of NS_ScriptName.txt as the button text.

 

I've figured out how to create a button from script using document.write() and how to find the location of my panel's HTML file using document.location.pathname, but I'm having trouble with the file and folder stuff, is there some sort of library I should include to regain File and Folder functionality such as .parent, .getFiles(), .name and .read()?


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>