I have it set to 'Basename only' so it will leave the extension alone. Recall the specified/selected file to rename. This will be used by the last action for the new filename. You can set it to whatever you're running, presumably 'bash'.Īssign the bash output to a variable. This is to remember which file you want to rename It is obviated by using this as a Service. This (or Get Specified…) is there to allow testing. I got the idea for variable usage from the answer to this question…Īpple Automator “New PDF from Images” maintaining same filenameĪt the top Service receives selected 'files or folders' in 'Finder'. Now, here is the workflow that includes the above bash command. …and produces this… GentiumBookBasic-BoldItalic In a single line, it looks like this… mdls GenBkBasBI.ttf | grep -A1 name_postscript | tr -d \ | tail -n 1 | tr -d \" So for the first 'tr' instance, there is an extra space after the backslash. In order, these strip spaces, all lines excepting the last, and quotation marks. com_apple_ats_name_postscript = (Ĭlean this up with some more bash (tr, tail)… tr -d \ | tail -n 1 | tr -d \" The 'A1' in grep returns the found line and the first line after, which is the one containing the actual font name. … generates this output, which contains FontBook's Postscript name. Mdls GenBkBasBI.ttf | grep -A1 name_postscript For simplicity here, I'll exclude the path to the selected file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |