Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Photoshop hotfolder to run action pc

Explorer ,
Nov 16, 2011 Nov 16, 2011

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

TOPICS
Actions and scripting

Views

3.2K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 16, 2011 Nov 16, 2011

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 16, 2011 Nov 16, 2011

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
}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 16, 2011 Nov 16, 2011

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 18, 2017 Apr 18, 2017

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

watch folder Dialog for photoshop javascript

please help me

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

LATEST

I have no knowledge of this script, however, a Bridge script that calls a Photoshop script may be an alternative.

 

Bridge Hot Folder.jsx

PShotFolder.jsx

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines