How to install a plugin in QuickLook on macOS

QuickLook is an awesome macOS feature that lets you preview files. If you have lots of files to go through, you’ll find it to be exceptionally helpful. It supports a large number of file formats, and for formats it doesn’t support, you can install a plugin. You will, of course, have to find a plugin for the type of file you want to preview in QuickLook. As for the plugin itself, it’s not going to be an installable package or DMG file that you can run. Here’s how you install a plugin in QuickLook.

Install plugin in QuickLook

A QuickLook plugin has the .qlgenerator extension. The plugin file you have might have downloaded as a zipped file. In that case, you can extract it with the built-in Archive utility on macOS.

Once extracted, you need to decide how you want to install the plugin i.e., system-wide, or just for the current user. The process isn’t complicated for either one so take that into account. In order to install a plugin in QuickLook, you have to move it to the QuickLook folder. This folder is located in the Library folder. Move the file to one of the following locations, based on how you want to install it.

System-wide

/Library/QuickLook/

User-specific

~/Library/QuickLook/

You may have to authenticate with either the admin or the user password before you can paste the file.

Once you’ve pasted the file, you have to do one of two things; you can either log out of the system and log back in to apply the change, or you can run a simple command in Terminal and skip the log out/in step.

If you want to run the Terminal command, go ahead and open the app and run the command below. It will complete within in a few seconds. Once the command has run, you will be able to use QuickLook and the plugin you installed.

qlmanage -r

Remove plugin from QuickLook

Removing the plugin from your Mac is as simple as installing it. All you need to know is where you copied the plugin file to i.e., which Library folder, the system-wide foldre or a user-specific one.

Once you know which folder the plugin file is in, you can delete it. When deleting the file, you may have to authenticate the change with the admin or user password. After the file has been deleted, you will either have to log out and log back into your system to apply the change, or you can run the same Terminal command given in the previous section and skip the log out/in step.

The post How to install a plugin in QuickLook on macOS appeared first on AddictiveTips.

How to add QuickLook support for text based files on macOS

A text editor might seem like a basic tool, and it is, but if you’re dealing with code files, you’ll find that they can mostly be viewed in a text editor. A text editor may not be ideal for code files, but it does work. A lot of files that you encounter e.g., README files, CHANGELOG files, Makefile files, etc. are all text based and can be opened in a text editor. On macOS, there’s a really useful tool called QuickLook that lets you preview lots of different file types and it supports text files provided they have a proper extension. It tends to not support quite a few files even though they’re text based all because of the file extension. To fix this little problem and add QuickLook support for all text based files on macOS, you need to install a little QuickLook plugin called QLStephen.

QuickLook support for text based files

Download the QLStephen plugin. To install this plugin, unzip the file. Go to one of the following locations (it’s up to you which one you pick), and paste the plugin file there.

If you add the plugin to the system library folder, you will need to authenticate with the admin password. If you add the plugin to a user’s library folder, you will need to authenticate with the user’s password.

System library

/Library/QuickLook/

User library

~/Library/QuickLook/

You have to then log out and then log back in to apply the change.

Once you’re logged back in, look for a file that you know is text based but that you cannot open/preview with QuickLook. Select it, and tap the spacebar. The file will open in QuickLook and in many cases, if you’re dealing with code, it will also be formatted for easier reading.

The plugin is great for a lot of niche files but it still isn’t going to add universal support for all text based files. You may still run into some file types that are locked or cannot be opened for some other reason. Case in point, a .BAK file which is text based but still couldn’t be preveiwed in QuickLook even though TextEdit was able to open it just fine. There will be exceptions.

This is an unfortunate shortcoming of QuickLook. It is an otherwise great feature that lots of Mac users find useful, especially when they have lots of files to sort through. Apple needs to look into improving QuickLook’sfile support, especially for text based files.

The post How to add QuickLook support for text based files on macOS appeared first on AddictiveTips.

How to fix “File could not be executed because you do not have appropriate access privileges” on macOS

AppleScripts are the common script type you’ll find on macOS but, there are other scripting formats that also work on the OS. One particular type of format is the .command format which is used to package Terminal commands. If you have a .command file, it is basically a set of commands that are meant to run in the Terminal. The file is going to save you the trouble of having to write the command out every time you need to run it. It’s simple enough but if you have a .command script that you’re trying to run, and you keep getting the “File could not be executed because you do not have appropriate access privileges” your script needs to be authorized to run.

What’s unhelpful about this error is that it points you to the worst place to fix it; the Get Info window. That isn’t going to be of any help. Here’s what you need to do.

Fix “File could not be executed because you do not have appropriate access privileges”

Open Terminal and run the following command. Replace ‘Path-to-file’ with the complete path to the .command file you’re trying to run. If prompted to, enter the user password.

Syntax

chmod u+x "path-to-file"

Example

chmod u+x /Users/Fatimawahab/Desktop/script.command

Once the command has been run, the file in question will have the permission it needs to run. Double-click it and it should run without any error messages.

This permission is set on a per-file basis. This means that while you can use the command to run the file that you entered the path to, you won’t be able to summarily run all .command files. For each .command file you want to run, you’re going to have to grant it permission first. Additionally, this is set on a per-user basis so the file can only be run by the user that it was granted permission by. That said, you can modify the command so that permission is granted to the script to run for all users. Simply replace the ‘u’ in the command with ‘a’.

Syntax

chmod a+x "path-to-file"

You will, of course, need to enter the admin password this time around because the change is being made for all users which isn’t something an ordinary user can do.

If you ever want to revoke permission for the file, run the following command.

Syntax

chmod -x "path to file"

Example 

chmod -x /Users/Fatimawahab/Desktop/script.command

The ‘x’ in the command basically makes the file ‘executable’. The minus sign that precedes it in the last command revokes that permission.

The post How to fix “File could not be executed because you do not have appropriate access privileges” on macOS appeared first on AddictiveTips.

How to run Terminal commands from a script on macOS

Terminal commands on macOS aren’t difficult to run. The only difficult or inconvenient part is where you have to type the command out. If you often have to run a Terminal command and you’re tired of having to type it out over and over again, it’s a good idea to just save it as a script and run it instead. Here’s how you run Terminal commands from a script on macOS.

Creating script

You can create the script in any text editor. macOS comes with a built-in text editor in the form of TextEdit. Open a new text file and enter all the commands that you want to run. Once you’ve entered the commands, save the file with the COMMAND file extension. Give it a name that will tell you what the script is for e.g., ScreenshotScript.command.

Save it anywhere you like.

Give the script permission

Open Terminal and run the following command. Replace ‘path to script’ with the actual path to the script you just created. You can get the path to the script by right-clicking it, holding down the Option key, and selecting the copy path option from the context menu.

Syntax

chmod u+x path-to-script

Example

chmod u+x /Users/Fatimawahab/Desktop/MyScript.command

That’s all you need to do. When you double-click the script file, it will open a Terminal window, and run all the commands in the script. You may see a prompt requesting certain permissions the first time you run the script so it’s a good idea to give it a test run before you make the script a part of your daily workflow.

The permission you grant the script is on a per-script basis. It is subject to the script and not the Terminal. What this means is that for each Terminal command you package into a script, you will have to give it permission before you can double-click it to run it. If you don’t, the script won’t run and the error message you get won’t be able to guide you much on what you need to fix. Make sure you do not miss this step.

There are other ways to run a Terminal command without having to type it out each time but a script is a flexible method to do it. If you share your script with someone else, they too will need to allow it permission to run from the Terminal before they can use it. The permissions are not inherited from one system to another when you share the script file.

The post How to run Terminal commands from a script on macOS appeared first on AddictiveTips.

How to add dividers to the menu bar on macOS

Apps that run from the menu bar, or that can be set to run from it instead of the Dock are convenient. The menu bar has more space, and unlike the Dock, you don’t have to access your essential apps from it. You can use it for all sorts of things e.g., controlling music, making quick notes, managing the volume, keeping an eye on your system’s resources, and more. An app that runs from the menu bar is hardly less capable than one that runs from the Dock. If you have a lot of apps in the menu bar, you might need an easy way to organize them. Consider using dividers for the job. Here’s how you can add dividers to the menu bar on macOS.

Add dividers to the menu bar

You can add dividers to the menu bar on macOS with a free, open-source app called Menu Bar Splitter. This app gives users the freedom to add as many dividers as they like, place the dividers wherever they want, and choose from three different ‘faces’ what type of divider to use.

Download and run the app and by default, it will add a vertical line to the menu bar. This is the default face that each new divider you add will have. Changing it is easy.

Click the divider that was added and from the menu, select the ‘Set Icon’ option. The sub-menu will show you the three types of icons you can add. The ‘Blank’ icon is basically a space instead of a vertical line and you can choose to make the space wider by selecting ‘Thick’ or make it narrow by selecting ‘Thin’ from its sub-menu.

The other two choices let you add the vertical line or a dot. To add a second divider, select the ‘Add Splitter’ option. Use the ‘Remove Splitter’ option to remove one.

By default, the splitter/divider is added at the very end of the line of icons already present on the menu bar. To move them around, hold down the Command key and then drag the icons on the menu bar to arrange them however you like. This rearranging is a stock macOS feature, and not something that Menu Bar Splitter adds.

You can change the arrangement of the menu bar any time you want. If you’re using an app to hide menu bar icons, you can use it along with Menu Bar Splitter to keep the menu bar organized as well as clean.

The post How to add dividers to the menu bar on macOS appeared first on AddictiveTips.