0

I'm putting together an installation using Processing, where users type and their text is printed on a receipt printer. I've got Processing saving out time-stamped text files to a folder, and a folder action in Automator watching that folder and sending to print. My problem is that these .txt files need some intervention...

  • Format > Wrap to page
  • Change margins
  • Select 80mm receipt roll in Page Setup

I think I have the margins thing figured out by adding some code to the file header on the Processing side. With the rest, I'm drawing a complete blank. I've tried setting the receipt roll as the default page size in 'Print and scan' in system prefs, but the receipt page size doesn't show in the list in system prefs, only shows on the page size list from within Text Edit application. I suppose what I'm asking - is there a way of setting TextEdit's default to page wrap, certain page size, certain printer - then a folder action can just print away (I hope). The idea is that these text files spit out of the receipt printer automatically with no intervention. Does anyone have any ideas? Thanks in advance.

4

1 回答 1

0

您是否尝试过 AppleScript 中可用于 TextEdit 的设置?如果您查看打印设置部分(在 TextEdit 的 Script 字典中),有许多可用选项,它们可以帮助您实现非常接近您想要的效果。然后,您可以将 AppleScript 放入 Automator 文件夹操作中的Run AppleScript操作中。

或者,您可以完全发疯,在 Pages 中设计一个符合您标准的模板,然后提取您的文本,粘贴到您的 Pages 模板中,然后打印出来。更多的工作,但一旦它成为功能,你只需要在未来更改页面模板以满足不断变化的需求。

于 2015-05-18T14:23:58.547 回答