Need a solution to open a custom file, print it, close it, and move onto the next file - windows

Forgive me if this is the wrong place to look for help, but I have a problem in need of a solution:
We have a large collection of files with unique names that only open up in a specific editor. Embroidery files specifically (.dst or .pof). What I would like to do is print a matching library of these files as .pdfs. So, what I am after is a script or program that will open the file in the editor, print it, close it, and then move onto the next file in the folder till all are output.
Does something like this exist? Is there a custom script I could execute that would accomplish this?

Related

using automator to select random lines of text and then paste into browser

I've got a test file with a bunch of words in it named input.txt.
In automator, I'm using run shell script to execute
sort -Ru input.txt | head -3, this returns 3 of the values from the list.
What I want to do next would be take that output and copy it then paste as plain text into a browser.
I've been looking around and I see a couple steps forward but maybe not in the right direction
A)
[set value of variable] -
use this to save previous items into a variable
[ask for confirmation] -
prints these onto a pop up
or
B)
[new textedit document] -
just save a new file with whatever has been copied
However I'm not sure how to move forward from there.
Again my goal is to take the outputs from the initial shell script and get them copied to the clipboard, so they can be pasted into a browser at a specific location.
AFTER pasting into the browser ideally I would use some sort of mouse recording to press a couple buttons on different parts of the screen.
If you are interested in the specifics I'm using this website https://www.prosepainter.com and want to essentially randomly select text to paste into it and then automate some iterations while saving the between iterations.
shell/automator are pretty new to me, so I'm sure I'm missing something basic.
thanks!

Create shortcuts for commands in windows 10

Its a general question, but I think that with my cenario is easy to explain. My deal is the following:
I have some files, I want to move them to a new folder that I am about to create, usually I press ctrl+shift+n to create a new folder, then I go to the files, select them and press to ctrl+x to cut, then go to inside the folder and paste.
I would like to do something like that:
Select the files, press some combination of keys, some that doesn't exist, and it creates the folder, let me give the name, and after I press Enter it moves the files to the folder autoatically.
Keep in mind that this should be something general, something I can write to a script or anything and use for multiple cenarios.

How to combine two image (png) files to print them in duplex using AppleScript

Right, so I'll try and explain this as clearly as possible;
As soon as two files are placed in the folder, I want a Folder Action to
print these files - got that...
but, and this is my problem. At the moment it prints the files after each other, and I want to make sure that they are printed together, duplex.
so far I've got this:
on adding folder items to this_folder after receiving added_items
do shell script "defaults write com.apple.print.custompresets com.apple.print.lastPresetPref Duplex"
tell application "Finder" to print these_items
end adding folder items to
so I reckon I need to combine/append the two files - so the printer sees them as one, and only one print job is the result, thus creating a duplex printed file :D
would be awesome if you have tips/ideas on how to solve this!
cheers!
I found a python script written by Martin Michel which will combine multiple images into one file. It should help you solve your problem... find it here. You may want to use image events to resize the images first before passing it to this script so they will fit properly on one printed page.
You could create a simple Automator Folder action, which would create a multipage PDF from the added image files, then either print it directly in Automator, or pass it on to an AppleScript in order to set your printer preferences.

BBEdit AppleScript for reformatting multiple files

I'm looking to write an Applescript which will utilize BBEdit — loop through a ton of HTML files and autoformat them (so the indentation is easier to read).
So far I have:
tell application "BBEdit"
activate
open {file "Macintosh HD:TEST DIRECTORY:testfile copy 2.html"} with LF translation
(format mode hierarchical)
beep
display alert "Finished!"
end tell
This applies the transformation to a single file, but has anyone got any suggestions how to apply this to an unknown number of HTML files?
You've almost got it; the trick is that you want to loop through the files returned by open. Thus, you need something like this:
tell application "BBEdit"
set docs to open LIST_OF_FILES with LF translation
repeat with doc in docs
-- format doc
save doc
end repeat
beep -- Or even `say "Finished!" without waiting until completion`
-- if you want your computer to talk to you
display alert "Finished!"
end tell
As you can see, all you need to do is place your formatting code inside this loop (and don't forget to save the files!); the loop will set doc to each element of the list docs in turn, and run the body with that element. If you're not sure how to select the files, one way is choose file with multiple selections allowed; this will pop up a dialog box which will allow you to select as many files as you want. To use it, just replace LIST_OF_FILES with (choose file with multiple selections allowed).
BBEdit will perform a find/replace on any group of files you want. Just hit command+shift+f to bring up Multi-File Search instead of the basic find/replace window.
If you have more than one set of find/replace commands that you need to execute at the same time, you need a Text Factory. See here for details on how to set one up: http://www.barebones.com/products/bbedit/benefitsexercise.html
Does that help?
You should use the Text Factory feature for this. Under "File > New > Text Factory". Any operation you can perform on a single file can be done on any number of files and you can save the operation for future use.

Fastest way to "jump back" to a file in TextMate?

Often, when I am reading code or debugging, I want the ability to quickly jump around files. I especially want to "go back" to where I was. I know about "Command+T", "Command+Shift+T", and, bookmarks. But, I cannot figure out a way to jump around files quickly.
UPDATE: I do not think I my question was clear enough judging by two answers given. Specifically, I am looking for a way to "jump back" to where I was in a file. I know how to navigate in TextMate (in general). I want to know if TextMate has a "jump back" key binding.
It's subtle.
The command-T thing has the files listed in Most Recently Used order.
So, you can go command-T return to get back to your last file real quick. At first I couldn't find it either.
I don't think there's a go to last edit location as there is in, say, IDEA/RubyMine.
Courtesy of MacroMates.com
2.3 Moving Between Files (With Grace)
When working with projects there are a few ways to move between the open files.
The most straightforward way is by clicking on the file tab you need. This can also be done from the keyboard by pressing ⌘1-9, which will switch to file tab 1-9.
You can also use ⌥⌘← and ⌥⌘→ to select the file tab to the left or right of the current one.
It is possible to re-arrange the file tabs by using the mouse to drag-sort them (click and hold the mouse button on a tab and then drag it to the new location). This should make it possible to arrange them so that keyboard switching is more natural.
One more key is ⌥⌘↑ which cycles through text files with the same base name as the current file. This is mainly useful when working with languages which have an interface file (header) and implementation file (source).
When you want to move to a file which is not open you can use the Go to File… action in the Navigation menu (bound to ⌘T). This opens a window like the one shown below.
Go To File
This window lists all text files in the project sorted by last use, which means pressing return will open (or go to) the last file you worked on. So using it this way makes for easy switching to the most recently used file.
You can enter a filter string to narrow down the number of files shown. This filter string is matched against the filenames as an abbreviation and the files are sorted according to how well they match the given abbreviation. For example in the picture above the filter string is otv and TextMate determines that OakTextView.h is the best match for that (by placing it at the top).
The file I want is OakTextView.mm which ranks as #2. But since I have already corrected it in the past, TextMate has learned that this is the match that should go together with the otv filter string, i.e. it is adaptive and learns from your usage patterns.
If you have a project window open, you can leave frequently-accessed files open (in tabs), and then use ⌘+1-9 to jump to open tabs.

Resources