Sublime Forum

Printing from sublime

#72

Sorry, perhaps I gave the wrong line number; the print statement should be in the second section:

elif PLATFORM == "osx": # lp -d <queue name> <name of document> # lp <name of document> will send to default printer(?) if QUEUE is not False: subprocess.call("lp -d " + QUEUE + " " + vw_filename) else: print(vw_filename) subprocess.call("lp " + vw_filename)

0 Likes

#73

Ok, now it puts the filename:

results.txt is the name of the file I am trying to print.

0 Likes

#74

It looks okay?! Is

/var/folders/rv/khlfpt5d15q40578f1sjz3f00000gp/T/results.txt

a valid osx path? Can you check if this file exists - I assume it should!

Otherwise, you could try adding the setting:

"queue": “yourprintername”,

to the QuickPrint.sublime-settings file, so that it tries to print to the named printer (rather than a default printer).

Thanks again for persisting with me…

0 Likes

#75

Yes, the file exists at that path (and I opened it and verified that it’s my file). I tried adding that line to the settings file, no change. Now I really need to go start the experiment I meant to start a few hours ago. :smile: I’ll check back later if you have more suggestions.

0 Likes

#76

This is also an experiment :wink:

No worries, and thanks again. For* some time later*:

Did your printer name contain spaces? This may be another issue.
I’ve updated my GitHub to use the folder /tmp/ for osx. If this doesn’t work then I assume that lp (or lpr) are not configured to the default printer by default, or perhaps there is some security setting(s) preventing access to the temp folder.

I’m hoping some osx-legend might contribute to our endeavours :smiley:

Added: The printer settings may need to be adjusted to accept TEXT input.
Finally: If/when you get a chance can you type lp pathtosometextfile.txt in Terminal to see if it prints.

0 Likes

#77

I do enjoy a good puzzle. :mrgreen:

My printer name does not contain spaces. I’ve re-downloaded the updated zip from github a few minutes ago and put it on my laptop at home (OSX 10.8.2), in case there was something weird about my work computer/printer setup, but the same “No such file or directory” error also occurs on my laptop.

I’m not sure what this means: “The printer settings may need to be adjusted to accept TEXT input.” I don’t see any options like that in my printer settings.

I am able to successfully print the file stuff.txt by typing “lp stuff.txt” in Terminal.

0 Likes

#78

I am at a loss…

Perhaps I will include an email client: it will post the file to me in an email, I’ll print it out and post it to you :smiley:. It means, though, there will be a slight delay between each print.

Hopefully someone else might offer suggestions :wink:

thanks again, Andy.

0 Likes

#79

Could try one last time :wink: . The current version saves the text file in the current location, just adding a .txt extension. This will at least eliminate the location of the file as the cause of the problem. Andy.

0 Likes

#80

Well, now it makes a different error, so that’s fun… I tried it first with an unsaved file, then saved the file as stuff.txt and tried again.

I’ll just use the Print to Html package instead. Opening a browser to print DNA sequences seems like overkill, but it works okay. Thanks for the good times; it’s nice to do some “experiments” that don’t involve pipetting clear liquids between various tiny tubes hundreds of times.

0 Likes

#81

@bbarrill
No worries; thanks for your time.

I don’t like to give up, but there’s nothing else I can do at the moment without input from others.

Andy.

0 Likes

#82

I’ve made another attempt by adding

#!/usr/bin/env python # and.. /usr/bin/lp

if anyone is will to give it a go in osx :smile:

0 Likes

#83

Please can someone with OSX test my QuickPrint feature briefly and let me know if it succeeds. Andy.

0 Likes

#84

Another vote for print support.

Yikes.

0 Likes

#85

I tried Sublime for a month, decided I liked it, paid for it… then needed to print something.

Surprise! This application does not print.

This sours the deal but doesn’t kill it. Sublime Text 2 is still an excellent addition to my library, but… wow. That’s a pretty basic feature. I expect I am among the masses taking that for granted.

Please consider making this a priority.

Thanks.

0 Likes

#86

I don’t know if native support for printing will ever be added to Sublime Text. Maybe in version 3 … But for the rare occasions I need it, this plugin works well enough: SublimePrint. I first created it as a quick hack last april. It was then substantially extended by Kai Ellinger a few months ago, and again cleaned up by me just now. It has been submitted to package control, but you can get it directly from github.com/svenax/SublimePrint until gets is added. Give it a shot.

0 Likes

#87

+1 for simple printing! Would be great even just to produce PDF pages of code. Right now there is no way from within Sublime to do this relatively basic task.

0 Likes

#88

+1, I was just recommended Sublime and the first feature I was going to use, printing in color after importing a piece of code is not implemented, so holding a little bit before migrating here for now.

Can you please update the thread when this gets implemented so I have another look?

Cheers.

0 Likes

#89

I just dropped $70 on what I had chosen as THE text editor in my tool set based on rave reviews and an impressive trial run. Obviously the trial didn’t last long enough. Seriously, how hard is it to print text to a printer? I don’t even need it to be syntax highlighted or anything. Oh, I get it…this is one of those jokes you play on the new guy. Ha, good one guys. You really had me going there. Now can I have the real version of the tool I just paid for?

0 Likes

#90

You must be joking. Is there anyone who writes text and never needs to print it? Do I really have to switch to another editor just to print the few lines that I need to print?
Is there any other editor that doesn’t print? Or is this some sort of religious thing, like single buttoned mouses?

Ahem, well, sorry about the rant. Just my +1.

0 Likes

#91

There are multiple plugins for this (producing IMO better output than any editor with built-in printing), most notably github.com/n1k0/SublimeHighlight.

0 Likes