Prefer my QuickLook plugin - macos

I am making a QuickLook plugin that will be included with my application. It will be used to preview a file type that other applications also have QuickLook plugins for. Every time I attempt to test with my plugin (I put it into ~/Library/QuickLook/) it previews with another app's plugin. I am using qlmanage to preview. Is there a way to force it to use mine, at least for testing?

Generators embedded in applications are always preferred to plug-ins in ~/Library/QuickLook (which are preferred to the ones in /Library/QuickLook, which are preferred to the ones in /System/Library/QuickLook).
There is no way to change this priority. Also if 2 generators at the same level claims the same type of file, Quick Look will prefer one over the other, whichever you can't control.
At least for your test, you can force qlmanage to use the plug-in you want by using the -g option (but you will also have to specify the content-type with -c).
Try qlmanage -h to get all the options for your tests.

While the order of precedence described by #julien is accurate, it is still possible to override a particular application's QL provider. Simply edit the Info.plist file in the .qlgenerator of the offending application. For example, I like the way a certain QL provider handles markdown, but one of the text editors I have installed includes (imho) less than stellar markdown support. My preferred bundle loses... until I edit:
/Applications/BadMarkdown.app/Contents/Library/QuickLook/BadMarkdownQL.qlgenerator/Contents/Info.plist
and remove
<string>net.daringfireball.markdown</string>
And in newer versions of OS X, you don't even need to restart the QL daemon. The preferred QL tool just takes over. =D

Related

Firefox configuration via CLI

During system setup and later for automatic testing (whether specific configuration settings are still effective) I am interested in configuring Firefox via CLI. I have seen one or the other command line tool but they would always cover only one aspect of Firefox and are usually bound to a specific version.
To be more clear about this, let me list some of the use cases for the CLI:
create/remove profiles
install/update/remove plugins
list installed plugins incl version
list configuration settings, get/set values (also for plugins)
clear cache/cookies/...
manage truststore
manage bookmarks
Is there no command line interface officially supported?
Firefox command line interface is indeed officially supported, but at this moment in time is under documented. While it's possible to find some outdated documentation, the in-tree documentation is only a stub.
Since you mentioned automated testing, you might also consider the approach currently being used by Mozilla to run tests on Firefox:
Generate a profile to be used for testing.
Tweak the preferences in the profile (e.g. using user.js).
Start Firefox using the generated profile (either using -p or --profile).
Execute your tests (with Geckodriver?).

Is it possible to create a standalone Quick Look extension/plug-in?

According to Apple we should new build Thumbnail or Preview Extensions instead of the old Quick Look generators which will be deprecated (probably in Big Sur).
There is also no Option to create a Quick Look plug-in project in Xcode anymore. Instead you need to create an application that contains a quicklook extension target.
My question is: Can I not create a standalone Quick Look extension (or plug-in) anymore to preview files without a useless wrapper app that fulfils no purpose? Has anyone tried or found out if this is still an option?
Thank you.

XPage Osgi plug in development

background
I have designed many tools in the past year or so that is designed to help me program for XPages. These tools include primarily helper java classes, extended logging (making use of OpenLogger and my own stuff), and a few other things that I personally feel I cannot work without. It has been discussed with my employer, and we feel that it might be a good idea to start publishing these items to openNTF. Since these tools are made up of about 3 .nsfs, all designed to use the same java code, key javascript classes, css, and even a custom control or two, I would like to consolidate key items into a plug-in that can be installed at the server and client level. I want to do this consolidation before I even think about publishing any of the work I've done so far. It would just be far too much work to maintain, not just for me, but for potential users. I have not really found any information on how to do such a thing in google searches. I also have to make sure that I am able to make use of the ExtLib libraries, openNTF Domino API, and the Notes API.
my questions
How does one best go about designing such plug-ins? Must a designer
use eclipse, or is this it possible to do this directly in the Notes
Designer?
How does a designer best go about keeping a server and client up to date while designing and updating the plug-in code? Is this why GitHub is often used?
Where is the best place to get material to get started in this direction? I sort of feel lost in the woods, knowing I need to head north, but not having a compass for that first step.
Thank you very much for your input.
In my experience, I found that diving into plug-in development is a huge PITA until you get used to it, but it's definitely worth it overall.
As for whether you can use Designer for plugin development: yes, but you will likely eventually want to not do so. I started out by using Designer for this sort of thing for a while, presumably with the same sentiment as you: why bother installing another instance of Eclipse when I'm already sitting in one all day? However, between Designer's age (it's roughly equivalent to, I think, Eclipse 3.4), oddities when it comes to working sets between the "Applications" and "Project Explorer" views, and, in my case, my desire to use a Mac app, I ended up switching.
There are two major starting points: the XSP Starter Kit (http://www.openntf.org/internal/home.nsf/project.xsp?name=XSP%20Starter%20Kit) and Niklas Heidloff's video on setting up Eclipse for XPages development (http://www.openntf.org/main.nsf/blog.xsp?permaLink=NHEF-8RVB5H). The latter mentions the XPages SDK (http://www.openntf.org/internal/home.nsf/project.xsp?name=XPages%20SDK%20for%20Eclipse%20RCP), which is also useful. In my setup, I found the video largely useful, but some aspects either difficult to find (IBM's downloads are shifting sands) or optional (debugging, which will depend on whether or not you're using Eclipse on Windows).
Those resources should generally get you set up. The main thing to worry about when setting up your Eclipse environment will be making sure your Plug-In Execution Environment is properly done. If you're following the SDK setup instructions, that SHOULD get you where you need to be.
The next thing to know about is the way plugins are structured. Each plugin you want to install in Designer or Domino will also be paired with a feature project (a feature can house several plugins), and potentially an update site - the last one is optional if you just want to import the features into an Update Site NSF. That's how I often do my normal plugin development: export the paired feature to a directory and then import the feature into the server's Update Site NSF and then install in Designer from there using Application -> Install. You can also set things up so that you deploy into the server's plugin/feature directories instead of taking the step of installing into an update site if you'd prefer. GitHub doesn't really come into play for this aspect - it's more about sharing/collaborating with your code and also having a remote storage location for your git repositories (which I highly advise).
And as for the "lost in the woods" feeling: yep, you'll have that for a good while. There are lots of moving parts and esoteric concepts to get a hold of all at once. If you mostly follow the above links and then start with some basics from the XSP Starter Kit (which is itself a plugin project that you can pair with a feature) - say, printing text in the Activator class and making an implicit global variable just to make sure it works - that should help get your feet wet.
It's best done in Eclipse. You can debug your code running on the server from there, as well as run it directly from there. The editors are also more up-to-date. You want:
Eclipse for RCP and RAP developers
XPages SDK for Eclipse RCP (from OpenNTF)
XPages Debug Plugin (from OpenNTF - basically allows you to load the plugins to the Domino server dynamically, rather than exporting to an Update Site all the time)
XSP Starter Kit on OpenNTF is a good starting point for a plugin. There are various references to the library id, which has to be unique for your plugin. Basically, references to org.openntf.xsp.starter need changing to whatever you want to call your plugin. You're also best advised to remove what you don't need. I tend to work in a copy of the Starter, remove stuff, build and if there are errors with required classes (Activator.java obviously will be required and some others), then paste them back in from the Starter.
XPages OpenLog Logger is a good cross-reference, that was built from XPages Starter Kit. It's pretty much stripped down and you'll be able to see what had to be changed. A lot of the elements of the XSP Starter Kit correspond to Java classes you'll probably be familiar with from your XPages Java development.
GitHub etc tend to be used as source control, which is useful for working out what's changed from time to time.

Xcode & Quartz Composer - perfect standalone

I have build my standalone app from a QC patch using Xcode. Everything works good however, I was wondering if it is possible to hide the QC patch when I do Show package nd I go inside my app.
Also, is there a way to use the stand alone even if people don't have the plugin I have used in my patch such as Kineme 3d, and there is a way to implement them inside my app?
thank you so much
Use Kineme QuartzBuilder:
It encrypts your composition, making it difficult for an end-user to extract and copy your composition.
It automatically bundles the plugins your composition uses (except Kineme AlphaBlendMode, which you need to manually add).
If you add a note at the top level of your composition containing your Kineme3D license key, the plugin will work on other systems when your composition is loaded. Obviously you should not distribute compositions that contain your license key, unless you use QuartzBuilder to package them (since then the license key is encrypted).

Text editor or a standalone tool for Mac OS with ability to compress JavaScript code

Here is the task: I would like my JavaScript code from different files to be compressed and concatenated into one file that is going to be used on a web page. The problem is that I'm pretty lazy :) and using some command line tools like, for instance, Apache Ant + YUICompressor each time I add a new line of code doesn't look attractive too me. Replacing uncompressed versions with a compressed final script before release is not a great option as well.
I know that such IDE as Eclipse allow to build project automatically after each update so it is possible to use already mentioned Apache Ant and YUICompressor in a build scenario to reach my goal. However Eclipse is too geeky for me, it's not that I can't figure out how to use it, I just don't feel comfortable using it. Maybe someone knows a good alternative (for Mac OS)?
PS. I hope I don't sound too capricious :) , after all having convenient tools is rather important for a programmer.
You can get a bundle for TextMate called JavaScript Tools that contain two built-in text compressors, available at http://andrewdupont.net/2006/10/01/javascript-tools-textmate-bundle/ . TextMate is available at http://macromates.com/ .

Resources