Best way to resize your MAC launchpad icons.

in scripting •  2 years ago  (edited)

Good day guys, How are you this weekend? This my first post beside the introduction post that I posted yesterday. As I have told you all in my introduction post, I would like to share some information or tips related to computer here in this blog. Mostly, I will share some of my experience doing programming, solving issues or some simple computer configuration.

img1.png

Changing your Mac Launchpad size is actually can be done by typing the command in Terminal. However, for me personally, I found that it is quite time consuming. Moreover, I easily forget the commands and need to browse the internet everytime I want to resize the icons. Than I start thinking, why don't I create a simple script to do the job so whenever I want to resize the Launchpad icons, I just simply need to run the script.

So, if you have similar problem, check out the instruction below to create the same script yourself.

Notice
The script is very simple. I will try to explain the instruction as easy as possible so that even non-computer background user could follow


Instruction


  • Open Script Editor application, you can search the apps from spotlight or found the app from your Launchpad.

img2.png

  • Once the apps is open, type the following code. Here is the full code. To make it yours, just copy this code and paste in on your text editor, then save it with ".scpt" extension
display dialog "How many columns?" default answer ""
set columns_answer to text returned of result
display dialog "How many rows?" default answer ""
set rows_answer to text returned of result
do shell script "defaults write com.apple.dock springboard-columns -int " & columns_answer
do shell script "defaults write com.apple.dock springboard-rows -int " & rows_answer
do shell script "defaults write com.apple.dock ResetLaunchPad -bool TRUE"
do shell script "killall Dock"

  • Test your script by running it. You can click "Run" button or simple press "Command + R" or Choose "Script" on the menu bar and click "Run".

img3.png

  • Once the script is run, you will be prompted with dialog box where you can input how many rows and how many columns do you want in your Launchpad. When you finish the input and hit "OK" button, your screen will flash for a moment and your Launchpad size is now changed.

img4.png


Details explanation of the code.


display dialog "How many columns?" default answer "" This line will display a dialog box where user input how many columns that they want and the user's input will be saved in a variable called "columns_answer". From the line code set columns_answer to text returned of result, here is the code to catch user input and save it to the variable. Next two line of code is similar. Display dialog box to asked for rows number and save it to "rows_answer" variable.

Next, after user input their desire rows and columns number, we need to take their input and apply it to the commands to resize the launchpad. There are 4 commands that we need to run. We can use do shell script to run a command from a script file. Those 4 commands are as shown in the following code lines.

do shell script "defaults write com.apple.dock springboard-columns -int " & columns_answer is to change the columns size. Notice that & columns_answer at the end, it is the variable from before where user input their desire columns number. Next command is to change the rows size which is do shell script "defaults write com.apple.dock springboard-rows -int " & rows_answer. Once the rows and columns has been set, next step is to allow the Launchpad to be reset with the following code do shell script "defaults write com.apple.dock ResetLaunchPad -bool TRUE". Then, finally, we need to restart the Launchpad with this code line do shell script "killall Dock


That is all on how you can resize the icons size in your Mac Launchpad.
You can also download the code above from my Github

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @mohdrezz! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.

To support your work, I also upvoted your post!
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!

Congratulations @mohdrezz! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!