Illustrator script will not print on the correct printer.
I call an Illustrator using BridgeTalk script within a script InDesign, but I doubt it would make a difference. Here's the question: we have four printers on the network that are named 'Printer 1', ' printer 2 "," printer 3 ", and"printer 4"on each Mac on the network." " I want to print a document to a specific printer, based on the computer that is used to run the script. Pretty simple idea and I have illustrated it in my script in progress below:
function illustratorDie(artFile, dieFolder, companyName, orderNum, shipDate, dieInks) { // Before anything else, find out to which printer we'll be sending our document. var machine = $.getenv("USER"); $.writeln("(IL) Environment variable 'USER' is " + machine); var localPrinter; var shipPrinter; switch (machine) { case "aerostar": $.writeln("Machine is aerostar."); localPrinter = "Printer 4"; shipPrinter = "Shipping"; break; case "apache": $.writeln("Machine is apache."); localPrinter = "Printer 3"; shipPrinter = "Shipping"; break; case "navajo": $.writeln("Machine is navajo."); localPrinter = "Printer 3"; shipPrinter = "Shipping"; break; case "seneca": $.writeln("Machine is seneca."); localPrinter = "Printer 2"; shipPrinter = "Shipping"; break; case "warrior": $.writeln("Machine is warrior."); localPrinter = "Printer 2"; shipPrinter = "Shipping"; break; case "tomahawk": $.writeln("Machine is tomahawk."); localPrinter = "Printer 1"; shipPrinter = "Shipping"; break; case "Marketing": $.writeln("Machine is Marketing."); localPrinter = "Printer 1"; shipPrinter = "Shipping"; break; default: $.writeln("Machine has defaulted."); localPrinter = "Printer 3"; shipPrinter = "Shipping"; } $.writeln("(IL) Thus, the local printer is " + localPrinter); // First, create a new document for the die. var dieDoc = app.documents.add(); // Then open the document that contains the artwork. var artDoc = app.open(artFile); // Group the art from the document with the artwork, // just in case it hasn't already been grouped. artDoc.layers[1].locked = true; artDoc.selectObjectsOnActiveArtboard(); var sel = artDoc.selection; var newGroup = artDoc.groupItems.add(); newGroup.name = "ArtGroup"; newGroup.move(artDoc, ElementPlacement.PLACEATEND); for (var i = 0; i < sel.length; i++) { sel[i].moveToEnd(newGroup); } // And copy the artwork from the art document to this new die document. var copiedArt = newGroup.duplicate(dieDoc.layers[0],ElementPlacement.PLACEATEND); // Now we can close the art document as it will no longer be needed. artDoc.close(SaveOptions.DONOTSAVECHANGES); // Back to our die document, let's fix up the art now. // We do so by first centering it on the page. copiedArt.left = ((dieDoc.width - copiedArt.width) / 2); copiedArt.top = (dieDoc.height + copiedArt.height) / 2; // Then we change all paths to black & white. // For this, we will assume that there are no gradients nor raster art. var pathsToRemove = new Array; var blackColor = new CMYKColor(); blackColor.cyan = 0; blackColor.magenta = 0; blackColor.yellow = 0; blackColor.black = 100; convertBW(copiedArt); $.writeln("Removable paths: " + pathsToRemove.length); for (var v = 0; v < pathsToRemove.length; v++) { pathsToRemove[v].remove(); } // Now specify the contents of that text block. var newLine = String.fromCharCode(13); var textContents = companyName + newLine; textContents += orderNum + newLine; textContents += shipDate + newLine; textContents += newLine; textContents += "W: " + Math.round((copiedArt.width / 72) * 100) / 100 + newLine; textContents += "H: " + Math.round((copiedArt.height / 72) * 100) / 100; // And finally actually place the text block while formatting it. var textDesc = dieDoc.textFrames.add(); textDesc.position = [36, dieDoc.height - 50]; textDesc.contents = textContents; textDesc.textRange.characterAttributes.size = 36; // Let's set print options for the two printers. var localPrintOptions = new PrintOptions(); localPrintOptions.printerName = localPrinter; var shipPrintOptions = new PrintOptions(); shipPrintOptions.printerName = shipPrinter; var myJobOptions = new PrintJobOptions(); myJobOptions.copies = 1; shipPrintOptions.jobOptions = localPrintOptions.jobOptions = myJobOptions; $.writeln("Printing to " + localPrintOptions.printerName); // Now we need to print this text block to the local printer as well as the Shipping printer. $.sleep(2000); dieDoc.print(localPrintOptions); $.sleep(2000); dieDoc.print(shipPrintOptions); // Before saving the file to an .EPS, we need to hide (or delete) the text block. textDesc.remove(); // Lastly, we need to save this document as an .EPS file in the proper location. // Set the SaveOptions first, just like the PrintOptions earlier. var dieOptions = new EPSSaveOptions { compatibility = Compatibility.ILLUSTRATOR16; preview = EPSPreview.TRANSPARENTCOLORTIFF; embedAllFonts = true; cmykPostScript = true; postScript = EPSPostScriptLevelEnum.LEVEL2; } // And then actually save the document. var savedFile = unescape(dieFolder.toString()) + "/" + artFile.name.slice(0,-4) + "_Die.eps"; $.writeln("Inside Illustrator script, savedFile is " + savedFile); dieDoc.saveAs(File(savedFile), dieOptions); // Finally, close the document. dieDoc.close(); return savedFile; // END OF MAIN. function blackIt (currentItem) { ... } }
I at first thought that the script was running too fast, so I added the two "$.sleep (2000)" orders near the end to see if it would help - it didn't.
The bits of important, after defining the variables localPrinter and shipPrinter, come after the line / / Let's define the printing options for both printers.
Instead of print to the local printer, sometimes it will print to the other. For example, I am the machine called "apache". The script must localPrinter on "Printer 3". And, according to the statement of $. writeln() , he does. However, despite this setting, almost always displays "Printer 2"! From time to time he actually does it print "Printer 3".
This happens on other systems, too. It almost seems as if it prints to a printer that is numerically the one less than that to which it is supposed to print. "aerostar" prints often to "3", "warrior" often it prints for "printer 1", and then the 'marketing' impressions, we do not yet all printers output a page!
What is the cause to happen and, more importantly, what can I do about it? Help, please!
Of course, I get another set of printers listed. Nevertheless, I found a solution for this. Since it seems that the printerName of PrintOptions property is buggy, I decided to try the printPreset property instead. I created of the presets on each computer, one for each printer and the accordingly modified script. Works like a charm now. Now the switch statement:
switch (machine) { case "aerostar": $.writeln("Machine is aerostar."); localPrinter = "Printer 4"; localPrintPreset = "Color Proof Printer 4"; shipPrinter = "Shipping"; break; case "apache": $.writeln("Machine is apache."); localPrinter = "Printer 3"; localPrintPreset = "Color Proof Printer 3"; shipPrinter = "Shipping"; break; case "navajo": $.writeln("Machine is navajo."); localPrinter = "Printer 3"; localPrintPreset = "Color Proof Printer 3"; shipPrinter = "Shipping"; break; case "seneca": $.writeln("Machine is seneca."); localPrinter = "Printer 2"; localPrintPreset = "Color Proof Printer 2"; shipPrinter = "Shipping"; break; case "warrior": $.writeln("Machine is warrior."); localPrinter = "Printer 2"; localPrintPreset = "Color Proof Printer 2"; shipPrinter = "Shipping"; break; case "tomahawk": $.writeln("Machine is tomahawk."); localPrinter = "Printer 1"; localPrintPreset = "Color Proof Printer 1"; shipPrinter = "Shipping"; break; case "Marketing": $.writeln("Machine is Marketing."); localPrinter = "Printer 1"; localPrintPreset = "Color Proof Printer 1"; shipPrinter = "Shipping"; break; default: $.writeln("Machine has defaulted."); localPrinter = "Printer 3"; localPrintPreset = "Color Proof Printer 3"; shipPrinter = "Shipping"; }
and the transfer block that accompanies it, which uses the new variable:
// Let's set print options for the two printers. var localPrintOptions = new PrintOptions(); localPrintOptions.printPreset = localPrintPreset; var shipPrintOptions = new PrintOptions(); shipPrintOptions.printerName = shipPrinter;
I hope this will help someone else who is faced with this problem!
Tags: Illustrator
Similar Questions
-
Any ideas why weather script will not appear in the index created with DW
For an example of what I want to do with DW, please see my page now created with CoffeeCup. It will cost $49.
This did not require a moment of my time asking them for help. It is not perfect and there are a lot of code that could be cut out, but it gives me results. I need assistance in support of DW to do what I know, the software can do, but maybe not easy at the beginning.
Why the weather script does not play when the page is created with DW, but when created with Publisher and cup of coffee?
Any help would be greatly appreciated.
I want to use Dreamweaver, really I do. I have a whole database downloaded with the software of connection Member, just waiting for me to install. I don't install it until I first get a handle on a bug of ugly time.
atmydeskworking wrote:
Why the weather script does not play when the page is created with DW, but when created with Publisher and cup of coffee?
The reason that the weather-report is not working in the Dreamweaver version of the page is that you have a gap between the words 'white' and '&' in the link below. Delete the gap and it will work. http://weatherreports.com/jscript.html?width=234&height=60&theme=white &location=Fairfax%2C%20Minnesota%2055332&units=f"
-
FLT Sim Airbus Series 1 & 2 will not load in the correct folder
Hello
I just bought Airbus series 1 & 2 MS FltSim x and he refuses to load it into the appropriate folder (cannot install this prog pse select your correct dir fltsim x) (c:\prog files\ms games\ms fltsim x files). The file is located in this directory already, but it will not in charge. It seems that all my fltsim x files are in a different directory (AJP\documents\fltsim x files) and not the one preceding.
I tried to rename the AJP file but will not work and I moved all the files for the fltsim x folder in prog file and still it will not work however, I also noticed that when I moved all the files of the AJP folder to put it in the folder of the prog and I try to play the game, it loads a .bin file in the folder of the AJP it each time.
My computer is a computer game of superior specification with 8 MB of memory and a graphics card excellent MS Vista Ultimate x 64 bit fully updated running.
I have had some problems before with FSX and had to use MS help and of the uninstall and reinstall FSX a few times and then after that it didn't even once I formatted my hard drive and did a full reinstall of everything and since then everything has been ok, but I tried to load the game on my laptop and couldn't as MS States that the game has been used many times , so I will not be able to uninstall again.
If you are not sure? So I am but if you can help I would be grateful.
Thank you
Hello andy04,
Thank you for visiting the website of Microsoft Windows Vista Community.
Try to install as an administrator. Right click on the installer and select run as administrator.
This should solve your problem.
Let us know if these steps solve your problem. I hope the information is useful.
Kind regards
Anthony
Microsoft Answers Support Engineer
Visit our Microsoft answers feedback Forum and let us know what you think. -
I installed a dell 720 photo printer to my new laptop Acer. It does not print. script line 2032-resi//ieframe.dill/preview.js error message comes up. the printer will not print but shows that its installation - HELP
Reinstall it using the right Vista 32-bit, if you have Vista 32 bit OS, since the link above of Dell printer drivers.
See you soon. Mick Murphy - Microsoft partner
-
MFP HP LaserJet Pro 400 M425dn will not print the text to format 72 points or more
My workplace has recently bought a M425dn of MFP HP LaserJet Pro 400 all-in-one printer. It works perfectly except for the fact that it will not print text that is 72 points or larger in size. I tried many fonts that are installed with Windows, and all them print correctly to the point size 71.5 or smaller; Another thing simply does not appear in prints. Content which is of size to 72 points or more * fact * affect the flow of the content printed on the page, however. It's like the 72 points or larger text takes up space, but it is completely invisible on the printed page.
I tested using Microsoft Word 2002 on three separate computers, of which two have installed Windows 7 and Windows Vista installed. The problem is the same on all three computers. The printer is connected via an ethernet cable to our wired network. I have installed the printer software included, and I don't think that there are updates for it that have not been installed up to this point.
Any thoughts on how to solve this problem?
Hello, I just made an account to solve this problem for you guys because it has been a puzzle to me also...
I apologize before the huge hand for the terrible grammar and punctuation that I'm in a hurry
Now it does not work for everyone but I fixed it on my machine with the following
now before you print it... .use (ctrl + p) in your text editor to open the print window, click (properties), and then navigate to the tab (Advanced) now, I have a section called the characteristics of the printer in this category there is an option to 'send truetype as bitmap' activate this and see if it can help someone of you, for me, with this PERMIT I can print any font size my processor will allow me to type
in my machine's plug
Reference Dell d6420
Win7
Msoft word 2007
printer itself is
HP laserjet 200 color m276
printer driver is
HP LaserJet 200 color MFP M276 PCL 6
I understand that this printer and driver is not identical to yours in itself, but the nature of these drivers makes it highly likely that this solution works for most of you
If this can help, someone else did post more because I'll probly do not sign in to this site I created this account just for this post and I hope to solve this annoying problem issue for many of you... .no necessary congratulations
-
laptop will not print, the problem is PRINTUI. Missing DLL
Hello. My computer Windows XP laptop will not print, and I found that the problem is PRINTUI. DLL is missing. I have a backup file on my hard drive, but I don't know which folder the file goes to. I have Windows XP Home edition SP2. Does anyone know the correct folder, that this file will?
Hi, Jtmcc,
Adding printers without interaction from the user in Windows
http://support.Microsoft.com/kb/189105
Is the common path: C:\ System32\ printui.dll WINDOWS\
What is printui.dll?
-
Have 2 printers on the computer and the PC will not print one when you switch to the other?
Have 2 printers on the computer and the PC will not print one when you switch to the other?
Having a printer at the office and one at home, but use the same PC for both? Unable to print at home after bring you it to the office (and vice versa)?
If you USB, most of the time, the PC will recognize what printer is which. Sometimes PORTS does not commute. You can manually change the correct ports if necessary.
CLICK ON THE MENU START
1 devices and printers
2 right CLICK on the printer
3. choose the PRINTER PROPERTIES
4. click on PORTS
5. There will be a list of ports with one (checked marked). If it's on the wrong port, change to the right pair and choose APPLY.
(NOTE: it must ALWAYS be on a USB port or a wireless connection.) Some ports wireless start with a #(adresse IP) or a SERIAL number)
I hope this helps. Sometimes, you can create your own port if you have more questions.
-
HP3050a - will not print on the Internet Explore or any email is web-based.
Here's the thing! My 3050 has is set up for the wireless. works great for any microsoft office program. Impressions like a dream. Works on all software for Iphone and Ipad. Wireless analysis. All fab. BUT it will not print through messaging on the computer web-based.
It is now a network computer - one that is. I have a PC that has a HP1050 via USB which works a treat in all programs.
I've updated the last IE web browser a few weeks ago, everything seemed fine then, but last week arrested two printers scan (rather the sweep feature missing from the pc). Charge both pilots as of the 1050's worked almost immediately. The 3050 took some back reset on the wireless - had evntually but every time now trying to print through the web-based e-mail I get a pop up that States:
Error running scripts
line 2072
invalid error or agruement procedure call
Code 0
URL: res:/IEframe.dll/preview.js
Regardless, if you choose to continue or cancell, that nothing happens - rebooted, reloaded, etc etc, but can't get the blooming thing to print from web-based e-mail. It used to work very happily but now... Help me please get really rather jolly cross!
I bet that this is due to a conflict between IE 9 and your printer driver. The only real solutions must use another browser, or use a different print driver. I'll link the steps to assign another driver print below in case this is the solution you want to go with. I hope this helps.
How to assign other drivers to print in different Versions of Windows
-
After setting up my new printer Hp Officejet Pro 8625 on Windows 7, it will not print the Page of 'Test '. I need help!
Also, when I roll over the image of the printer in the task bar, he says '0' of documents, so that it does not print.
After setting up my new printer Hp Officejet Pro 8625 on Windows 7, it will not print the Page of 'Test '. I need help!
Also, when I roll over the image of the printer in the task bar, he says '0' of documents, so that it does not print.
Thanks to everyone who responded to my help regarding my Hp OJ Pro 8625. After all, I ended up doing a clean reinstall of my MS Windows 7, and reinstalling the Hp JO 8625 Pro software and that's all working now. Some hoe there is a glitch in my Windows 7 that did not leave the Hp software to install correctly. Once again thank YOU ALL!
-
I use a Brother MFC-7420. Usually, it works under Windows 7, but from time to time (maybe 1 in 20 times) he will not print and I have to unload the coil and switch off the printer before Relighting. It is not always the case, but it is enough times to be a nuisance.
Ideas, people?
Hello
This problem occurs when you make changes to the computer?
Method 1: Diagnose and automatically fix problems printing and printer
http://support.Microsoft.com/mats/printing_problems/
Method 2: Refer to this link: I can not print from my computer via the USB port.
If you have problems, I haveinstall updated printer drivers, see this link:
http://www.brother-USA.com/downloads/default.aspx?PgId=5&R3ModelID=MFC7420Refer to this: update the drivers for hardware that does not work properly.
http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly
See also: printer in Windows problems
http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-WindowsI hope this helps!
-
Photoshop CC 2015 (Norwegian version) will not start. The following message: Adobe Photoshop CC has stopped working. A problem caused the program stopped fungeresom correctly. The program will be closed and you will be notified if a solution is available.
reset your preferences-
Acrobat: http://help.adobe.com/en_US/acrobat/X/pro/using/WS58a04a822e3e50102bd615109794195ff-7feb.w .html
Adobe media encoder: https://forums.adobe.com/thread/1713540
Legacy: http://helpx.adobe.com/after-effects/using/preferences.html
Bridge: https://helpx.adobe.com/bridge/kb/troubleshoot-errors-freezes-bridge-windows.html
Dreamweaver: https://helpx.adobe.com/dreamweaver/kb/restore-preferences-dreamweaver-cs6-cc.html
Flash: http://helpx.adobe.com/flash/kb/re-create-preferences-flash-professional.html
Illustrator: http://helpx.adobe.com/illustrator/using/setting-preferences.html
InDesign: https://forums.adobe.com/thread/526990
Lightroom: https://helpx.adobe.com/lightroom/help/setting-preferences-lightroom.html
Muse (mac): https://forums.adobe.com/thread/1246022?tstart=0
Photoshop: https://forums.adobe.com/thread/375776
Photoshop elements: https://helpx.adobe.com/photoshop-elements/kb/preference-file-locations-photoshop-elements .html, http://www.photokaboom.com/photography/learn/Photoshop_Elements/troubleshooting/1_delete_p references_file.htm
elements of first: https://helpx.adobe.com/photoshop-elements/kb/preference-file-locations-photoshop-elements .html
First pro: http://www.mediacollege.com/adobe/premiere/pro/troubleshooter/trash-preferences.html
If that fails, uninstall, clean (http://www.adobe.com/support/contact/cscleanertool.html) and reinstall
-
5512: 5512 printer will not print black - 3 of all colors print correctly
Hello
The 5512 will not print black. New cartridge installed. Clean print head run more than 5 times without problem. There was many 5512 'no black printing problem' not noticed on this forum with many courses of resolution. I followed the instructions found on so many comments, but unfortunitely, the problem still exist. I noticed there were some done private view so I don't know that there is a similar problem that needs to be processed offline. Thanks in advance for any help provided.
Thank you all for the suggestions.
Nothing has worked for don't solve the "no black ink.
So, I took the print head of cart and carefully protected the small circuit board on the back side. There is a large accumulation of ink on the bottom of the Assembly. I sat the nozzles at the bottom of the distribution of very hot water and allowed some time to soak. From there on, I used carefully some fabric material and q-tips to wipe the nozzles. Then I got very hot water, and he ran to the top of the side of the Assembly to the screens and through the nozzles. This effort lead to a very large discharge of ink black and color. I dried the Assembly and reassembled the transport to the printer. Placed all the cartridges back in, ran clean printhead once and then guess what? the printer now prints black and color inks better than he has in years.
Total time needed to perform this cleanup was less than 30 minutes from start to finish.
Good luck to all of you who have this problem.
Before the rampage of the printer, it is interesting to try this fix.
Good luck!
-
MY hp c4500 wireless printer will not print. Troubleshooting says my printer is not communicating with the wireless router. I've checked everything. Unable to find the answer.
Hello
As OEM HP is responsible for the good operation of the printer and their drivers. Check with
HP support, their documentation online and drivers and ask in their forums.Good luck, you need to update or reinstall the latest driver.
Support HP & drivers
http://welcome.HP.com/country/us/en/support.htmlContact HP
http://welcome.HP.com/country/us/en/contact_us.htmlHP forums
http://h30434.www3.HP.com/PSG/=============================================
The main issue is probably the drivers, but these can help:
Add or remove a printer
http://Windows.Microsoft.com/en-us/Windows-Vista/add-or-remove-a-printerSolve printer problems
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-printer-problemsOpen the printer Troubleshooter
http://Windows.Microsoft.com/en-us/Windows7/open-the-printer-TroubleshooterFind the manufacturer's Web site
http://Windows.Microsoft.com/en-us/Windows-Vista/find-a-printer-manufacturers-websiteFind and install printer drivers in Windows 7
http://Windows.Microsoft.com/en-us/Windows7/find-and-install-printer-driversI hope this helps.
Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="">-><- mark="" twain="" said="" it="">->
-
my HP Photosmart 2610 all-in-one, said that he will not print because the transport is blocked. Well, he is not stuck. Yet, I can't print. I printed close to 20 000 cards because I bought and installed printer. What should I do? can you recommend a printer to buy. Looks like it's ready for the 'OS' yard HELP. PAUL LACNY * address email is removed from the privacy *.
Hello
Perhaps he is worn and requires little (routine) maintenance (20,000 sheets is a lot of printing).
As OEM HP is responsible for the good operation of the printer and their drivers. Check with
HP support, their documentation online and drivers and ask in their forums.Good luck, you need to update or reinstall the latest driver.
There are three models, so enter-> Photosmart 2610 - in the link of the HP driver and select the version
you have - then select your version of Windows.Support HP & drivers
http://welcome.HP.com/country/us/en/support.htmlContact HP
http://welcome.HP.com/country/us/en/contact_us.htmlHP forums
http://h30434.www3.HP.com/PSG/=============================================
The main issue is probably the drivers, but these can help:
Add or remove a printer
http://Windows.Microsoft.com/en-us/Windows-Vista/add-or-remove-a-printerSolve printer problems
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-printer-problemsOpen the printer Troubleshooter
http://Windows.Microsoft.com/en-us/Windows7/open-the-printer-TroubleshooterFind the manufacturer's Web site
http://Windows.Microsoft.com/en-us/Windows-Vista/find-a-printer-manufacturers-websiteFind and install printer drivers in Windows 7
http://Windows.Microsoft.com/en-us/Windows7/find-and-install-printer-driversI hope this helps.
Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="">-><- mark="" twain="" said="" it="">->
-
Printe will not print. Says that 'the printer door is open', but no door is open
Printe will not print. Says that 'the printer door is open', but no door is open
Hi ElliotBrahms,
1. What is the brand and model of the printer?
2. what operating system is installed on the computer?
3. you have made no changes to the computer before the broadcast took place?
4. when exactly you get this error message?
5. What is the exact error message you get?Method 1
Try the steps from the following link:Printer in Windows problems
http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows
Method 2
Try the steps from the following link:
Solve printer problems
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-printer-problems
Maybe you are looking for
-
A friend used by mobile phone and played sopme region 3 DVD. The DVD is now stuck on region 3. I live in Europe and cannot now play my European DVD. Can I reset the DVD firmware to allow me to return to region 2? DVD is SD-R2212.
-
I tried to update 9.2.1 then my phone suddenly exploded not far no answer, I tried so many ways what should I do?
-
I ask to check if the file sound.bar is on is the cd or not. I'm unable to explore the disc on my computer to determine if the file is there or not. Overall, the progress bar indicates that the installation was almost complete. There are some light s
-
I have router WRT54GR. I just set up the WEP security that worked well on my laptop, then on my second computer. I'm struggling now to put up on my son's computer. He is using the Linksys adapter, but it will not even connect to the internet route
-
I'm using windows 7 64-bit proferssional, pls help.