Display dialog box only once and apply setting for the whole batch of images - photoshop-script

I wrote a simple jsx script, which displays a dialog box containing a list of checkboxes and 'Continue' button, which on click executes various commands depending on which items from the list were ticked.
As this script is supposed to be part of an Action Set, I created an action which just executes this script.
When I run the command File > Automate > Batch > The above action on a Folder or opened files, the dialog box shows for every image from the batch.
Is there any way to show this dialog box only once and apply all its settings to the whole batch?

The better way to accomplish this is to add a folder picker to your dialog and modify the script to loop through all images in the folder (or open files, whatever your needs are) rather than attempt to run the script via an action. If you really must have it in an action, the way I have done this before is to write a xml config file that the script will look for and apply the settings from there - skipping the dialog altogether.

Related

Shell script to create new file on right click for macOS

I would like to add a context menu item in MacOS Mojave which gives the option to create a new file in the finder on a right click (the way you would in windows). I would also like to be able to specify the file type (text, word, html, css, javascript, etc)
I have followed a tutorial online in order to create the context menu item with automator but I am not familiar with writing shell scripts.
is it just as simple as:
for f in "$#"
do
touch "$f"
done
I was able to implement this following the instructions here: How to get Create New Text File from context menu
The only drawback as it stands is that you need to select a folder in finder to get the context menu. I would like to be able to click in the current I am in and get the menu but I can live with this. Hope this helps someone else.
This tool provides the "Create a file here" option out of the box. With this tool you can easily create your own options as well by writing simple shell scripts. The tool is free and the page has a link to the source if you want to check the source. The source has a shell script that creates a file in a directory that is given as an argument to the script. The script avoids file name conflicts when creating new files.

Running Batch File According to Drop Down List Selection

I am looking to run one of two batch files based on the user's selection from a drop-down list.
I've managed to create the batch file, but don't know where to start creating the form the user will use.
Here are the requirements:
It needs to be something that can be emailed out to users.
When they click it they get a Windows form opening which asks them to
make a selection from a drop down list (Option A or Option B)
Once they make their selection and click 'Run', it then runs either Batch
file A, or Batch file B, depending on which option they selected in
the drop down list.
The batch file will be stored on a server in a
shared folder they can all access.

Adding more actions to right click on Windows "copy and paste"

I need some ideas of adding more actions to right click on Windows copy & paste when dealing with files.
Our users need to have a function that opens a file when they Paste a copied item to a new location.
I was thinking to create a HTA window with vbs or javascript functions to accomplish this, just wondering if there will be easier way to do it by modifying default Windows Paste action in registry, running a batch or vbs script.
Or if there will be other ways to do so?

Alfred Action to open set of possible actions

I have custom Alfred workflow to File Filter some folders of my choice. I have two actions - to browse with Alfred, and, with CMD modifier, to open in Sublime.
I want to have an action where I may choose which program I want to open it in. I use 2-3 programs for basic editing, so I want to be able to select one of these.
Workflow would be:
start my workflow
enter few chars to find file
select a file with CMD
choose editor of choice from the list
How to implement the last thing? In other words, how to implement incremental actions e.g. "do this with this and then this".
There're two ways to do it.
Because you can choose which application will be used to open the file instead of the default one. A simple idea is using different keyword for each application. e.g. vim [file-name] for vim while sublime [file-name] for sublime.
Another way is using Run Script instead of Open File. An Apple script or Bash script can get the result in File Filter and open different application as you wish.

How to programmatically intercept OSX (10.8) print command?

Basically, if I'd like to be able to handle a print job initialization command. Like hitting Cmd+P on a document or something. I'd like to be able to access the data being printed and programmatically handle it rather than through a GUI.
Thanks!
You can possibly use the OSX automator to do what you need here. It depends on what you want to get out of the printed document. Automator allows you to create print plugins, which you can select from the system print dialog. I see you mentioned already that you don't want to use the "PDF" print menu as is, but perhaps some value can be added with extra automation in a print plugin. The plugin will create a .pdf of the printed documents, to which you can apply an automated sequence of actions.
Start /Applications/Automator
Under "Choose a type for your document:", choose "Print Plugin"
Then set up a sequence of actions you need to process your printed document. For example, you might want to do "Extract PDF Text" or "PDF to Images". Type "pdf" in the search field to see all the pdf-related actions available.
Save the automator workflow. You will only be able to give it a name, but not save it as a file in an arbitrary path.
You can use the plugin by opening the system print dialog in any given application, then dropping down the "PDF" menu in the bottom left-hand corner. You should see your plugin appear there.

Resources