Photoshop Javascript solution for auto naming - javascript

I am a photo editor with constant high quantity turnaround. I've come up with a partial automation solution to my problem by creating an action that takes my image, and automates the process of duplicating it 4 times, automatically opening the cropping bounding box on them all, letting me crop the needed aspect ratios, and then automatically opening the save for web box on all the images (and then closing all except the original file. I still need to name each file individually though.
What I would like to add to that action is some type of script that automates further. I would like to get the initial save for web option, type in my file name, and then have a script to add the pixel dimensions to the end of that filename, and automatically use that filename and the pixel dimensions of the next 3 images saved automatically.
IE- my action runs. Save for web box comes up for image 1 of 4. I type in "this_is_my_photo01_". Then the script would take that file name and save the four images with that and the dimensions of the photo (this_is_my_photo01_800x450.jpg, this_is_my_photo01_600x400.jpg, this_is_my_photo01_800x800.jpg, this_is_my_photo01_800x125.jpg)

Photoshop is (almost) completely scriptable, using Javascript, VBScript or Applescript (on Mac). This will allow MUCH more flexibility in generating names for images etc. than you will get with simple actions.
The Adobe guides are located here.
There is a tutorial here.

Related

How to create a single page pdf from a html file

How to create a single page pdf from a html file
I'm currently using the convert-html-to-pdf library (version: 1.0.1) to convert html files into pdf. But, the conversion is separating my html in multiple pages and it ends up breaking the code (streched divs).
Since my html file is responsive to certain needs, the size of the div blocks change on each file, and because of this I'm not able to determine when to "break" each page unless I somehow measure the size of the page and the size of the blocks.
There are two possible corrections:
create a single page pdf (this one is preferred)
mesaure the size of the page and compare with the items to make sure they are not separeted each page
The first one is supposed to be easier, but I can't find anything in the documentation that helps me do that.
I'm inclined to accept libraries suggestions to create a single page pdf.

Set PDF Initial View Window Options to Show Document Title (instead of File Name) Programmatically

I have scripted Acrobat Pro DC via VBA to overlay Annotations (Comments) from files having the same name.
However, I need to display the count of the number of input files in the Window Title.
I've figured out how to set the Document Title property of the PDF from VBA using Acrobat IAC, but cannot figure out how to change the File > Document Properties > Initial View > Window Options > Show box from File Name to Document Title using VBA or JavaScript or PowerShell or the like. I see I can set OpenInfo and DisplayDocTitle using a .sequ Batch Sequence, but am unable to call Batch Sequences from VBA or JavaScript or PowerShell.
Would you have any ideas, advice, or products that can be run on many user's computers (all do have Acrobat Pro DC) that could help me change this attribute on each file as I have it open, or on all the files within a folder?
Not a solution here, but an answer:
An expert contractor reinforced that Adobe chose not to provide access to this in the scripting model, and did less wiht the IAC model. I'm buying from him an example with source (closed-source, so he can have it on his site) example plug-in to set the parameter, then call the plugin's menu item with my script.
The parameter exists in the Document Catalog under ViewerPreferences > DisplayDocTitle (Boolean).
Therefore, I'm closing the question since a solution is in the works.
The thermometer proposal won't meet the needs, since I need to continuously display a property without affecting or blocking the drawing itself and without affecting, and without affecting the filename. Thermometer is not guaranteed continuous and can block parts of the drawing.

Is there a way of making wordpress upload to a specific directory so i can point a javascript script at it?

I'm doing work for a client with wordpress, i'm relatively new to wordpress. They want a gallery that will display images based on what they upload, they're not technologically inclined in the slightest bit. Wordpress seems to upload into different folders for each month and year, i'd like to avoid having to get javascript to plough through x amount of folders every time the page loads.
Things i've tried so far:
Using next gen gallery: This works, to a point, the 'responsiveness' of the gallery is not very responsive, it's set images that just wrap, meaning you're left with a large border down one side of the gallery until the screen gets small enough that it then wraps again...
Creating my own plugin: I've not done this before and there isn't really enough time for me to have to learn a whole new syntax.
Using advanced custom fields: This requires either premium to create a gallery, or adding alot of fields to every page and just checking the field is blank, then exiting the loop.
So, what i would like to do is allow my client to upload into 3 set directories, say Cars, Planes and Boats with different images for each, then on the relevant page, call my javascript function with a parameter for the folder that will then generate the gallery.
Is this possible?
Am i re-inventing the wheel?
You can change the default uploads folder for WordPress by adding this to the wp-config.php file:
require_once(ABSPATH.’wp-settings.php’);
define('UPLOADS', 'wp-content/images');
Just create whatever sub-directories you need in there and it should be fine.
Open the WordPress wp-config.php file, and then add the following code after require_once(ABSPATH.'wp-settings.php'); declaration.
define( 'UPLOADS' , 'files' );
New uploaded files should now be stored in a "files" folder, as shown below.
Copied from: www.hongkiat.com/blog/wordpress-custom-upload-dir/
This Works, I have tried it.

on click of button convert html page to image and download using JS ,Jquery

I have created a invoice based html page which has a button. onclick of the button, the html page should be downloaded as a image. using javascript or jquery.
I don't expect this to be the best answer, but it seemed interesting enough to post.
Write an app (may be with PhantomJS) that opens up the desired HTML document, sizes the window properly, and takes a screen shot. Then, remove the borders of the image.
(OR)
HTML2Canvas exists to render HTML onto (which you can then use as an image). (This may be of some help after converting to canvas - how to save canvas as png image?)

How to scrape relative images

If i look at Amazon Button to add items to lists on their site - you can see it here:
http://www.amazon.co.uk/wishlist/get-button
How does it work? I'm pretty sure it scrapes the page somehow but it seems to get every image whether its a flash image, jpg or anything, even when the site in question uses relative img src as opposed to absolute full site urls
Example page below, all images shown are jpg which is cool but all img src are relative meaning no "http://blah.com" before them
http://gadgets.guardianoffers.co.uk/p-788-Casio-Solar-Powered-Edifice-Watch.html
Is there a better way to get images other than parsing the html source?
Or are they just doing a million ifs if they don't get a hit straight away?
It looks like it parses the HTML of the page and looks for what is semantically identified as the primary image, name and price. For example, if you look at a page that doesn't have any ecommerce products, for example: http://www.theglobeandmail.com/ it takes the page h1 element as the product name and the primary image (front page story image) as the product image.
So behind the scenes they are doing a lot of guessing. Using HTML 5 semantic markup, you could establish a standard for this kind of thing, but unless everyone is using it, you are just making educated guesses.

Categories