How to use Shell script to cut App icons of various sizes in MAC
This article focuses on "how to use Shell scripts in MAC to cut App icons of various sizes in batches". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use Shell scripts in MAC to cut App icons of various sizes in batch.
Before the APP is put on the shelves, it is not a programmer's job to cut the various sizes of Icon needed on the shelves one at a time, and this requirement can be solved by using the sips tools that come with Mac.
With regard to sips, direct execution in the terminal can result in the following information:
The code is as follows:
Sips 10.4.4-scriptable image processing system.
This tool is used to query or modify raster image files and ColorSync ICC profiles.
Its functionality can also be used through the "Image Events" AppleScript suite.
Try 'sips-- help' or' sips-- helpProperties' for help using this tool
It is a script image processing system that can be used to query and modify image files.
Here is the newly written IOS App Icon clipping script, saved as a .sh file, and executed by typing sh xx.sh in the terminal:
The code is as follows:
#! / bin/sh
Filename= "icon.png"
Dirname= "cutimg"
Name_array= ("Icon-29.png", "Icon-29@2x.png", "Icon-40@2x.png", "Icon-57.png", "Icon-57@2x.png"Icon-120.png")
Size_array= ("29", "58", "80", "57", "114,120")
Mkdir $dirname
For ((iSuppli)