How to write a Terminal file that can help me out

Sanpeligringo

macrumors newbie
Original poster
Jan 17, 2020
4
0
I want to make a terminal file that chooses each green labeled files within a certain folder and unzips the “Links.zip” and then creates folders (named: Edited, Buildings, Extra, Front Cover, Interior, Map, Properties (Properties has three sub Folder inside: CGI, Floor Plans and Properties 290x200px) and Town) it the organises each file within the folder into those categories based upon its name





It also creates another Folder within each green labeled file called “Optimised” with the same subfolders (named: Edited, Buildings, Extra, Front Cover, Interior, Map, Properties (Properties has three sub Folder inside: CGI, Floor Plans and Properties 290x200px)





Then uses photoshop to optimise the files within the “Links” folder, in each green tagged folder, to certain parameters e.g Quality 3, 1400px width and 1400px height and places them into the “Optimised” file within.





Then starts another photoshop optimisation with “Links” subfolder “Properties” and it’s sub folder “CGI” and then places them into the sub-sub-folder of “Optimised” - “Properties” - “Properties 290x200px) with the settings Quality 10, 290px width and 200px height





Then takes an InDesign File within the green tagged file and exports each page as a high quality .jpg, into a file named “jpg” and then optimise those pages using photoshop with a quality 10, px 1500 width and 1500 height into a subfolder within that folder called “Optimised”





I need it to loop with every green tagged file within a folder





I have so many files to go through exactly like this, I wanted to automate it as it’s rather over whelming, I have tried Automator on Mac, but I’m so lost. Can anyone help?
 

barbu

macrumors 6502a
Jul 8, 2013
512
560
wpg.mb.ca
I don't think using bash (terminal) scripting is going to help here. This looks more like something you'd do in Automator or AppleScript.
Sadly, this is a huge job. It's unlikely we can help since it is very specific and involves high-end software. I have no doubt it can be done, but you might be better off booking an appointment at the Apple Store (if possible). They may be able to guide you through it, if you can get a decent genius.
 

Sanpeligringo

macrumors newbie
Original poster
Jan 17, 2020
4
0
I don't think using bash (terminal) scripting is going to help here. This looks more like something you'd do in Automator or AppleScript.
Sadly, this is a huge job. It's unlikely we can help since it is very specific and involves high-end software. I have no doubt it can be done, but you might be better off booking an appointment at the Apple Store (if possible). They may be able to guide you through it, if you can get a decent genius.
I thought that might be the case, I attempted it through Automator but as I have never used this before, I tried using record; which worked except I don't know how to get it to run on more than one file! I can write an AppleScript for the Photoshop and InDesign files.

But the fact of the matter is this is a huge ask anyway, so thank you for your advice! I will book an appointment! Thanks!
 

revmacian

macrumors 68000
Oct 20, 2018
1,661
1,355
USA
I agree with barbu.. perhaps an Automator service would be more efficient. Also, is Photoshop scriptable in the manner desired? I wonder if ImageMagick would be a better choice.
 
  • Like
Reactions: Sanpeligringo

Sanpeligringo

macrumors newbie
Original poster
Jan 17, 2020
4
0
I agree with barbu.. perhaps an Automator service would be more efficient. Also, is Photoshop scriptable in the manner desired? I wonder if ImageMagick would be a better choice.
Brilliant, I will attempt it again! Good idea! I tried recording a Macro and used the script load option through the inbuilt image processor:

<ImageProcessor>
<version>1</version>
<useopen>false</useopen>
<includesub>true</includesub>
<source>/Volumes/New Housing Dev Files/Links</source>
<open>false</open>
<saveinsame>false</saveinsame>
<dest>/Volumes/New Housing Dev Files//Optimised</dest>
<jpeg>true</jpeg>
<psd>false</psd>
<tiff>false</tiff>
<lzw>false</lzw>
<converticc>false</converticc>
<q>3</q>
<max>true</max>
<jpegresize>true</jpegresize>
<jpegw>1400</jpegw>
<jpegh>1400</jpegh>
<psdresize>false</psdresize>
<psdw>1</psdw>
<psdh>1</psdh>
<tiffresize>false</tiffresize>
<tiffw>1</tiffw>
<tiffh>1</tiffh>
<runaction>false</runaction>
<actionset>Default Actions</actionset>
<action>Vignette (selection)</action>
<info></info>
<icc>false</icc>
<keepstructure>true</keepstructure>
</ImageProcessor>

Perhaps this is too complicated, so early on - I might just stick with manually optimising each file!
 

Sanpeligringo

macrumors newbie
Original poster
Jan 17, 2020
4
0
I have tried with Automator, I haven't even had any success with the first issue, I can't seem to get it to search within a file for any other folders which are labeled with green. I tried writing Applescript and JS, but I had no success.
 

madmin

macrumors regular
Jun 14, 2012
180
268
This sounds like something you can do with the 'tag' utility, available via homebrew.

Repo here: https://github.com/jdberry/tag/

brew install tag

For example you can list files with the 'Green' tag like this

tag --match Green

Once installed you can read the man page for more options:

man tag

You'll probably want to pipe '|' the output from 'tag' into another utility like 'xargs'
to process the selected files as required...
 
Last edited:

seangrimes590

macrumors member
Jun 21, 2012
46
48
Villanova, PA
Are you offering payment? If so I may be interested (currently a CS Ph.D. student). This is far too much of a time consuming job to do as a free favor to a stranger on an Apple forum.

Me, if interested in proof if you're offering payment: seangrimes590
 

mariogt

macrumors member
Jun 28, 2012
35
28
Santiago, Chile
You can do that with AppleScript, but its not a easy task, you best bet is hiring a decent AppleScript programmer for this job (if you are not a programmer), also PhotoShop and Indesign have to be scriptable (I don't know if the actual version are).