which I always open with the application called PTouch
How do I write a macro to do so, ie open that specific file (a label that I print out)?.
I spent an hour fishing through all possible actions, but can’t find a simple ‘open file’ command. I don’t need to select via Finder, because I already know the file name and path.
Follow up question: would it even be possible to design a macro to complete the whole procedure, it also print the file Cmd-P in Ptouch after loading the file.
If it is not asking too much, is there any way to complete the whole procedure, ie open the file, (as per your instructions), print Cmd-P + Enter, and put the application PTouch in the background.
The trickiest part in making this macro robust is going to be the timing.
Opening a document will take some time, and it’s difficult to know how much.
For a fixed document like this, you can probably do something like Pause Until Front Window title contains “Diltex Shipping label”, then simulate the Command-P.
Typically that will produce a print sheet, so you need to allow for the animation time of that, and then perhaps control that or just simulate a Return to print it.
Knowing when the print is finished would be tricky too, but you probably don’t care, just hide PTouch at that point and it can print while in the background.
A message from The Man himself !!!
thank you very much for your reply.
I purchased KBM a few weeks ago: you are a genius. There is no other word. Can’t believe that I have not had this software years ago. Probably because reviews classified it with ‘application launchers’, so I arbitrarily chose Butler, which is a nice app, but nothing like KBM.
KBM is a pure delight. Thanks very much and keep up the good work!
Peter is right (of course). You often have to tweak a macro to get the timing right for your system and apps. Two key Macro Actions I use for this are:
Pause for n.nn Seconds
Pause Until Conditions Met
like "front window title" is or contains ...
or "front window of app TBD exists"
Here is an example of a real macro I use many times a day:
Some of the "Pause n.nn Seconds" may appear unnecessary or too long to some, but they are there because I found I needed them after using this macro for a while. I tend to be conservative and provide longer Pauses than absolutely necessary just to make sure it will work. It doesn't bother me to way an extra 0.2 of a second to get it right.
YMMV. Tweak the timing for your needs and preferences.
Thank you very much for your comment.
I had a problem, and it was solved by pause, as you suggest. I am very grateful
I will look into the until conditions met function. It seems very interesting.
cordial regards
Um, this is a built-in feature of OS X, has been since day 1, but hardly any one knows about it
(It has been too long but I think it was even a feature in OS 9 )
Select the document in the Finder (but don't open it) and press Command+P. It will open the document with the default app, print it, and close the document. Tada!
A few things to be aware of
It doesn't quit the application after it has sent the document off to the print queue
It uses the current preset for the print options so you will need to open the document, choose the print option to show the dialog, set any special printing options you need, then save it as default or choose the "Last Used Settings" option as the default.
It will use the default printer. If you have only 1 printer, you are fine. If you have more than 1, open the System Preferences > Printers pane, select the printer you want to use from the Default Printer pulldown menu at the bottom. The default setting is "Last Printer Used".
If you don't want to open the folder to select the file, you can make an alias of it on the desktop. Command+p works on aliases too!
If you don't want to even have to select the file at all and make KM do everything for you (and who doesn't want that?), set up this macro as a global shortcut (like Ctrl+Shift+P) and you can print a label anytime!