CS4: get file name after saving for web
Hello,
I am saving a file via "save for web" with a specific file name in a specific folder maybe with a specific resolution (width x height) entered directy within this dialog window.
Is it possible to get this path and the optionally changed resolution via Adobe script (after saving the file; or starting the script just before "save for web")?
Thanks a lot!
Carlos
I don't see anyway to get the user's options from the SaveForWeb dialog. The descriptors for both charIDToTypeID( "Expr" ) and charIDToTypeID( "Mn " ) are empty.
But you can use the DOM to sfw. Below is a function to save jpg using sfw.
function SaveForWeb(saveFile,jpegQuality) {
var sfwOptions = new ExportOptionsSaveForWeb();
sfwOptions.format = SaveDocumentType.JPEG;
sfwOptions.includeProfile = false;
sfwOptions.interlaced = false;
sfwOptions.optimized = true;
sfwOptions.quality = jpegQuality; //0-100
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);
Look up ExportOptionsSaveForWeb in the scripting guide for other formats.
You would have to do the resize as an extra step when saving using the DOM.
Similar Messages
-
Indesign CS4 "forgets" file name when saving as Postcript file.
Like the title says Indesign CS4 "forgets" file name when saving as Postcript file.
Example:
I open up indesign CS4 and open up a file called "test5". Then I go to the print menu and save it as a postscript file. Once the save as dialog box comes up it wont say "test5" but it uses whatever file name I used last time I created a PDF.
I want indesign to recognize that when I create a postscript file that I want it to be named the same way as my file that is open at that moment. Changing the file name every time is not bad when they are called "test5" etc but here at this company we use super long file names and it's a pain to change it every time.
Funny thing: Some machines here do it the way in the example but other machines will do it the correct way by using the same name in the save as box.
Any suggestions on how to fix this? If something is not clear just ask!How about this - it's a workaround, I can't change ID or your system.
I'm big on EXACT filenames also, case and space sensative. Do a "Save As" before printing - the file name should be correct and highlighted, ctrl+c copy, escape/cancel the Save As. Paste in the filename during the Save as Postscript File. -
Adding suffix to jpg file name? Save for web?
Hi,
I'm very new to Applescript but, with the help of a few others (thanks H), I've managed to successfully write a script to produce various versions of a selected set of photos. However what I would also like to be able to do is to add a suffix of the letter "w" to all the photos which end up in my Webpics folder and the letter "t" to those which end up in the Webthumbs folder. i.e. abc.jpb becomes abcw.jpg and then abcwt.jpg.
I'm sure this isn't hard but I've had a good look through various forums and tried loads of different things and still seem to be failing. If anyone can help I'd be hugely grateful. My script is below.
Also, does anyone know if it is possible incorporate a script for Photoshop / ImageReady which does the "save for web" thing? i.e. so that the photos in the webpics/webthumbs folders have been saved for web. At the moment I use an ImageReady droplet which does the job but I'd love to be able to script it in.
Many thanks, Eddy
set original_folder to (choose folder with prompt "Choose Folder containing the files")
tell application "Finder"
if not (exists folder "Webpics" of original_folder) then make new folder at original_folder with properties {name:"Webpics"}
if not (exists folder "Webthumbs" of original_folder) then make new folder at original_folder with properties {name:"Webthumbs"}
set copies_folder to folder "Webpics" of original_folder
set copies2_folder to folder "Webthumbs" of original_folder
duplicate every file of original_folder to copies_folder
set the_files to every file of copies_folder
repeat with each_file in the_files
set each_file to each_file as alias
my dophotoshop_stuff_to(eachfile)
end repeat
duplicate every file of copies_folder to copies2_folder
set webthumbs_folder to folder "Webthumbs" of original_folder
set the_files to every file of webthumbs_folder
repeat with each_file in the_files
set each_file to each_file as alias
my dophotoshop_stuff2_to(eachfile)
end repeat
end tell
on dophotoshop_stuff_to(thisfile)
tell application "Adobe Photoshop CS"
open this_file
do action "Masterpic to Webpic" from "Set 1.atn"
close current document saving yes
end tell
end dophotoshop_stuffto
on dophotoshop_stuff2_to(thisfile)
tell application "Adobe Photoshop CS"
open this_file
do action "Webpic to Webthumb" from "Set 1.atn"
close current document saving yes
end tell
end dophotoshop_stuff2to
Mac OS X (10.4.4)Ok, here is your script, not tested, but seems like it should work. The idea of shortening this script is that instead of duplicating files (simpler but longer, and you may face a timeout if there are a lot of files), you can pass the original file along to your script, that'll resize it and save the new version in folder 1, then resize it again and save the newer version in folder 2.
Make a copy of the original files before you start testing
Rookie Developer Hint : Slip in a display dialog followed by a return when testing to check the intermediate output.
Return stops your script where you slip it.
set original_folder to (choose folder with prompt "Choose Folder containing the files")
tell application "Finder"
if not (exists folder "Webpics" of original_folder) then make new folder at original_folder with properties {name:"Webpics"}
if not (exists folder "Webthumbs" of original_folder) then make new folder at original_folder with properties {name:"Webthumbs"}
set Webpics_folder to folder "Webpics" of original_folder
set Webpics_path to ((original_folder as text) & "Webpics") as string
set webthumbs_folder to folder "Webthumbs" of original_folder
set webthumbs_path to ((original_folder as text) & "Webthumbs") as string
set the_files to every file of original_folder
repeat with each_file in the_files
set file_name to (items 1 thru -5 of (name of each_file as text))
set each_file to each_file as alias
display dialog "Full path to the file: " & (each_file as text) & return & return & "Short name: " & file_name
set each_file to each_file as alias
set WebpicTarget to (Webpics_path & file_name & "W") as string
my dophotoshop_stuff_to(eachfile, WebpicTarget)
set webthumbsTarget to (webthumbs_path & file_name & "T") as string
my dophotoshop_stuff2_to(eachfile, webthumbsTarget)
end repeat
end tell
on dophotoshop_stuff_to(thisfile, saveTarget)
tell application "Adobe Photoshop CS2"
open this_file
do action "Masterpic to Webpic" from "Set 1.atn"
save this_file in saveTarget
close current document --saving yes
end tell
end dophotoshop_stuffto
on dophotoshop_stuff2_to(thisfile, saveTarget)
tell application "Adobe Photoshop CS2"
open this_file
do action "Webpic to Webthumb" from "Set 1.atn"
save this_file in saveTarget
close current document --saving yes
end tell
end dophotoshop_stuff2to
HTH
J. -
Why is same file different sizes after saving for web?
I have files that I save in PSCS3, under, "Save for Web & Devices" and I indicate under "optimize to file size" that they should be no larger than 60K. After item is saved and I go to "Get info", it says the file is 60K. Yet when I open the file in PS and go to Image Size, it says 467K. Why the discrepancy? Thanks for your feedback!
One is the compressed file size on disk (60K). The other is the uncompressed image size (369 pixels x 432 pixels x 8 bits per channel x 3 channels / 8 bits per byte / 1024, since K really is 1024, not 1000).
http://en.wikipedia.org/wiki/Image_compression
[Yoink!] -
Add exif-data while / after saving for web?
I use "save for web" quite often. However; i would like to add some exif-data to the picture after it is saved. Is there any way to do this with JavaScripting in Photoshop (CS3) ?
[email protected] wrote:
> I use "save for web" quite often. However; i would like to add some exif-data to the picture after it is saved. Is there any way to do this with JavaScripting in Photoshop (CS3) ?
There are limits to the kind of exif data that you can alter in an image. Most
of it can't be touched. You need to use an external app like Bridge or exiftool:
http://www.sno.phy.queensu.ca/~phil/exiftool/
-X
for photoshop scripting solutions of all sorts
contact: [email protected] -
File error when saving for web
When trying to save a file for web (png) it says that the operation could not be completed because the file not found and will not save. Why is this?
Hi Suki,
I have described the "problem" in detail on my blog today, and prescribed a solution as well. Let me know if this solves your problem!
http://rwillustrator.blogspot.com/2008/03/of-document-sizes-and-crop-areas.html
:) Mordy -
Thumbnail images corrupt after saving for web
I am working with CS2.
Whenever I choose "Save For Web," the thumbnail preview on the desktop doesn't show the full image. Half of it is grey. This only happens when I choose save for web. Sometimes if I single-click the thumbnail, the entire image appears. But most of the time, it stays half grey. I'd appreciate any help on this, since it's been going on for a year now, and re-installing didn't help.Save For Web generates an icon of the image on both my home Mac and work Mac. I've changed the preferences in PS to "Never Save" Image Previews. That has done nothing. So maybe it is an OS glitch, but I can't find anything to change. And again, this only happens when I choose Save for Web.
-
What is the best way to keep high res when saving "for web"
the files i'm saving for web so i can get them in jpg (or gif) format are coming out very pixelated. this is when i print the image.
what is the best way to save for web an image and keep the resolution good.
using for a business card template. avery template will let me attach images i want to the project. to do this.. i "get file from computer" and it drops the image in but real small... then you are supposed to enlarge it onto your work however you want. well when i enlarge this image file, it gets pixelated badly. i'm thinking it's the way i'm saving it. i do not adjust anything when i save. maybe i should. this is where i need guidance.
this is what avery template notes about the images i am allowed to use - When uploading the image, the maximum size allowed is 4 MB. You can only upload JPG and PNG images either as RGB or CMYK. so when you recommend things, can you please keep this in mind
thank you for oyur time.Aida,
When you save with the default template using save for web it is generally a very low settings.
While in the save window you can define the pixel size of the image you want with quality as well as resolution too.
Refer to tv.adobe.com video save for web or Adobe help file for detailed instructions.
Mandhir -
I have read the topics and tried the tricks and still have black backgrounds on my photoshop graphics. After saving for web & devides as png8 with transparency I have a checkerboard pattern behind my graphic. I am using the magic wand tool, selecting the emptiness/checkerboard behind, then choosing to select the inverse, the ctrl c, then ctrl v in iWeb
Thanks for any help.
KristieWhen you use the Save For Web or Devices be sure to click on black in the pallet and then on the transparent "button" just below the pallet before saving as a png file.
OT -
Original file turns modified after "Save for Web-"
Hi everyone!
I'm with a little question.
What happens to the edited file after saving its copy using the “Save for Web…” command? Why the original, unmodified file turns into “changed” (with * symbol after its name)?
P. S. The same behaviour is in the Illustrator.It's because the original file did get changed, because the Save for Web settings were changed. Photoshop saves most Save for Web settings so that the next time you use Save for Web, you don't have to set all the options from scratch.
I tested this by opening a file and using Save for Web without changing any settings, and that time the original document did not ask me to save before closing. -
PSD layouts saved for web and devices show up as broken links in dreamweaver. Previews in browsers are fine, but I keep getting and error message that says the files have been blocked. What is the fix for this?
You can also try out Project Parfait. It's a new experiment from Adobe that’s currently online and free to try out and use.
It allows easy PSD comps-to code workflows.
Project Parfait (Beta) - PSD CSS Extraction, Measurements and Image Optimization Service for the Web
-Subhadeep -
Change File Name In The "File Download" Dialog Box For Web Reports
Hi All ,
I followed the below note to change the "File Download" name.
How To Change The File Name In The "File Download" Dialog Box For Web Reports? Doc ID: Note:418366.1
However its not working. Has anyone tried this and works fine ?
Basically I wanted to change the name "rwservlet" when a report is run in an
excel format.
Rajesh Alex
Rajesh AlexHello,
Have you checked if a HTTP header "Content-disposition" is returned ?
You can use ieHTTPHEaders for IE
http://www.blunck.se/iehttpheaders/iehttpheaders.html
and
Live HTTP Headers for FireFox
https://addons.mozilla.org/en-US/firefox/addon/3829
Regards -
Losing quality when saving for web after using Multiply
I have a normal photograph, with a red layer on top set to Multiply/Darken. When I save it for web, regardless of what pixel size, or what uploader I use the quality is terrible.
Have tried uploading to different services, from difference devices with the same issue, so assume it's a colour profile thing.
Any help appreciated.
Image shows the difference in quality compared to normal.04dalyj wrote:
I have a normal photograph, with a red layer on top set to Multiply/Darken. When I save it for web, regardless of what pixel size,
DPI is pixel size and images are not displayed on screens with the pixels sized as specified in images resolution setting. The images pixels are displayed on displays with pixels the size the display is run with. So web images display on display, display with different sizes and resolution depending on the users display device.
Images saved for web display should be saved with sRGB colors for many image viewers are not color managed and assume web images have sRGB colors.
So you images will display differently on different displays and no matter how you save them colors will vary displays may not be calibrated all displays do not have the same color capabilities.
The best you can do is calibrate your display and save them with sRGB colors jpeg or png files that display well and look good on your calibrated display.
Most desktop displays are 100DPI resolution displays where newer tablets and laptop have high resolution displays 200 to 300DPI. Even new Desktop 4k display have lower resolution. I believe the highest resolution 4K display in production is the Dell 24: display . Its resolution is 185DPI. Out of production is IBM's old 4K display which had a 204DPI resolution. -
How can I get PS CC to always load my preferred Preset while saving for web output?
For my purposes, I'd prefer to save all JPEGs at 100% quality while saving for web output. I've made a preset as seen below.
However, PS doesn't always defer to this setting when I begin saving an image for web. Is there a way to make this preset automatically
load every time I open the output to web process? I process a large number of images, and if I could avoid correcting this it would save me a lot of time.
I'm using PS CC on a PC. Any help will be appreciated!This is the only custom preset I've made with this particular system. So I'd need to delete the pre-loaded PS presets?
I'm a little loathe to remove the options in case they might be needed in the future or for a task other than the primary one described. -
Artboard name and save for web or export
Hi when saving for web or exporting an artboard is there any way to pre-populate the save file name dialog box with the artboard's given name. It would save having to re-name the file and make good use of that metadata.
Thanks in advanceThere is a way, but you have to use file >> export >> jpg.
Worked great for me here where I have my artboards named the flavor, and when asked for fielname used "a".
Maybe you are looking for
-
I can't sign into itunes on my ipad (original) since the software update. Genius can't help-says its Itunes support I need, but they don't help either (tell me to reset password) which I've done several times. Can't update apps on my home computer ei
-
Problems installing forms 10g (9.0.4.0.1) on windows XP
Hi, i i'm trying to install Oracle developer suite 10g_r1 (is the one we are using in other computers) on a clean windows Xp image (no previous installations of Oracle, or Developer) but after checking the system specifications and before asking wher
-
How can I save passwords on Internet Explorer? SometimesIE does notask it automatically.. I configured InternetExplorer settings to save passwords but that's not helping. Is there any tool of Microsoft or Windows?
-
SharePoint / Outlook: email to document library?
hi - We have SP 2007 and Exchange/Outlook 2007. Is it possible to have all email (with attachment) that is sent to a certain distribution list directly to a SP document library?
-
Write Back for Fiscal Year Change_AJRW
Hi Team, Please tell me there is any option where we can revert fiscal year change for AJRW, once it has been already run.We are not talking the reverse of asset year end closing ,OAAQ, please share some view if any.. Thanks in Advance, Dharmveer