Copy link to clipboard
Copied
I am trying to figure out how to set up a hotfolder on a windows system that will run an action on an image file and send it to another location. I have read the discussions on this, but they all seem to be Mac based. Unfortunately, this is not an option for me. I am unfamiliar with all functions under file/scripts. I don't need to start at square one with creating actions, have that down, just creating the rest to make that action run whenever a file is dropped into a hotfolder. The action is really simple, just resizing the image, and saving for the web.
Thanks in advance. Kurt
Copy link to clipboard
Copied
As a start you could look at this...
http://www.ps-scripts.com/bb/viewtopic.php?f=13&t=3877&sid=ffd720e8f6d79ae7fa8c2a4a0d913687
Copy link to clipboard
Copied
Paul-
Thanks for the reply. I understand the link you posted is supposed to work in conjuction with Bridge... the following script was posted there (posted her so no one has to hop off this page). Where do I go to insert this script into Bridge? How do I define what action I want and how do I specify the folders to watch and to push to?
It kinda seems like I am supposed to save the following into a separate file and load it on the screen of image processor... can you clarify? Appreciate the help!
_______________________________________________________
#target bridge
if (BridgeTalk.appName == "bridge" ) {
var newMenuHF = new MenuElement( "menu", "Hot Folder", "after Help", "myHotFolder" );
var hf = new MenuElement( "command", "Start Hot Folder", "at the end of myHotFolder" , "qazw" );
}
hf.onSelect = function () {
startHotFolder();
}
function startHotFolder() {
Stop = false;
TopBar = app.document.navbars.filesystem.top;
TopBar.height = 30;
TopBar.visible = true;
TopBar.bu1 = TopBar.add ('button',[5,5,100,25],'Stop');
TopBar.bu1.onClick = function() {
TopBar.visible = false;
TopBar.remove(TopBar.children[0]);
Stop = true;
}
var toDoFolder = new Folder(app.document.presentationPath + '/Processing');
var flagFile = new File(toDoFolder + "/toDo.dat");
if (!toDoFolder.exists) toDoFolder.create();
var hotFolder = function(event) {
if ((event.type == 'close') && (event.object instanceof App)) {
return {handled: !Window.confirm("Are you sure you want to quit?")};
}
if ((event.type == 'loaded') && (event.object instanceof Document)) {
if (Stop) return {handled: true};
app.document.deselectAll();
var sels = app.document.getSelection("jpg, tif, cr2, crw, nef"); //file types to select and move
if (sels.length > 0) {
// A text file is created for each file(s) moved
var fList = new File(toDoFolder +"/" + new Date().getTime() +".txt");
fList.open("w", "TEXT", "????");
$.os.search(/windows/i) != -1 ? fList.lineFeed = 'windows' : fList.lineFeed = 'macintosh';
for(var a in sels) {
sels[a].moveTo(toDoFolder);
fList.writeln(decodeURI(sels[a].name));
}
fList.close();
// Create a flag file, if exists Photoshop should be processing
if (!flagFile.exists) {
flagFile.open('w');
flagFile.close();
var bt = new BridgeTalk();
bt.target = "photoshop";
/////////////////////////////////////////////////////////////////////////////////////////
// This calls an action to run the Photoshop script
// Amend as required
bt.body = "doAction('HotFolder', 'Hot Folder');";
bt.send(4);
}
}
return {handled: false};
}
return {handled: false};
}
app.eventHandlers.push({handler: hotFolder});
hotFolder("loaded"); // Deal with any files that exist
}
Copy link to clipboard
Copied
This isn't a working script as such, it's just a starting point to create a hot folder. There would a fair bit of work to do to get a working script.
It needs a way of processing the files that have been moved. In this example it's creating text files of fiiles that have been moved into the "processing" folder off the current folder that is selected in Bridge. Also it invokes an action (again needs to be created) it is suggested that the action calls a script to process the text files it finds in to processing folder (needs to be written), loads the files and process them.
It needs a fair amount code to get this working to process as not everybody would want to do the same thing, that's why the code is just a starting point only.
Copy link to clipboard
Copied
There is your answer:
Automatically run scripts on files in a specific folder
It needs a network and a free computer, but it works.
Copy link to clipboard
Copied
watch folder Dialog for photoshop javascript
please help me
Copy link to clipboard
Copied
I have no knowledge of this script, however, a Bridge script that calls a Photoshop script may be an alternative.