I just created a screensaver project in Xcode. How do I change the name as it appears on the screen saver selection dialog in MacOSX. I'm referring to the string bellow the thumbnails, like "Floating", "Flip-up", etc in this screenshot:
Note: I don't want to change the name of the screensavers that were shipped with MacOSX. I want to change the name of my own. The screenshot is there just to illustrate what I mean by name.
This took me a little while to figure out. There should be a file called InfoPlist.strings in your project (create one if not, I suppose), with an entry CFBundleName. This is the string used to generate the title, at least as of OS X 10.11.
The name you use for your screensaver (.saver bundle) will be the title it's represented as when viewed in System Preferences > Desktop & Screen Saver.
Example:
In XCode you might have a screensaver project named: Amazing Things.
When you build/compile an Amazing Things.saver bundle will be created (similar to an .app)
The main executable Amazing Things resides in Amazing Things.saver/Contents/MacOS
Screensaver titles are fetched from the .saver bundle and displayed as such in OS X.
(note the title in System Preferences reflects that of which the project was named):
Related
I am creating an app for Mac OS, but it is being built on Linux. Because of this, I am not able to use tools such as Xcode, and I am not developing in swift. Rather, the .app directory is being put together according to Apple's documentation, and the entrypoint/executable of my app is a shell script.
I need to customize the menu which appears when you right click on the app (either on the dock icon or in Finder). Is there a way to do this, without using cocoa, etc.?
The menu I believe you are referring to is called "Services".
In order to add a menu item there for your application you would create a script to enable including it there. Xcode isn't needed or required, however, you'll need to know at the very least some basic AppleScript or Javascript to accomplish what you want. (see examples from the link)
↳ Mac Automation Scripting Guide
I'm porting a PyQt4 (PySide) application that I wrote for Linux and Windows to OS X, menus seem to be otherwise OK out of the box (i.e. Help menu that only has About in it is magically moved to the "main menu" and a File menu is created just fine, but the "main" menu is titled Python instead of Application name.
I call self.setWindowTitle("Appname") in MainWindow.__init__() and self.setApplicationName("Appname") in Application.__init__() but the result is this:
How can I fix this? - Preferably in a way that my app still looks the same as it did before on Windows & Linux.
So it looks like Mac does something different than the other OS systems. I don't have a Mac so I can't really test it out but I think on a Mac the QMainWindow.menuBar() function does not return the application wide menu bar. You might try creating menubar like.
menubar = QtGui.MenuBar()
that has no parent.
I'm getting this information from the following links.
From the documents
Deploying an Application on Mac OS X
Also, it looks like the file Info.plist in "The Bundle" section of the second link is where the application name would live.
I'm sorry I can't be of more help but I hope this information will help you. Good luck!
I am developing an cocoa application for Mac and what i need is to add an item in the context menu that appears when user right-clicks on specific file and folder (i.e. when user click on file or folder by pressing ctrl key of keyboard).
I am new to Cocoa application development. I have searched in google for it and found that it can be implemented by using CFPlugIn. Does anyone know how to use CFPlugIn to implement this or any other method to add item in context menu of specific file or folder??
Thanks in advance
You can use system services for contextual menu. you should refer Services Implementation Guide. take a look at Services step out in Snow Leopard article.
If you wish to sell your product on apple app store than you should not follow dropbox.
This is no longer supported in Mac OS X 10.6 and Mac OS X 10.7. Earlier versions of Mac OS X had support for contextual menu plugins, but this feature has since been removed.
What is it you're trying to accomplish in the broader sense? If you give us an idea of what your goal is, we may be able to suggest an alternate way to accomplish it.
Using System Extensions and a FinderSync extension you can accomplish this.
https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Finder.html
I create a window in a helper tool that runs in the background (it's not an app bundle with a .nib and Info.plist, but a plain executable). When -makeKeyAndOrderFront: is called, the window is displayed but it does not "pop" out like an active window.
Can this be fixed?
Regards,
Erik
You should wrap the helper tool as a regular .app bundle with at least Info.plist. Then the problem goes away. A GUI app in OS X needs to have an Info.plist to receive events correctly.
The way a GUI app misbehaved if not in an app bundle has never been clear to me. If I remember correctly, it changed over time, depending on OS X's versions. I think it behaved worse in previous versions of OS X. For example, the window is shown but I couldn't click any UI inside it.
Many people who compiled a program in a cross-platform toolkit faced this problem, see e.g. this discussion here in the WxWidgets wiki. Apparently, OS X doesn't mark a program not within an .app bundle as a foreground-able app, which causes your problem. You can use TransformProcessType from your binary not inside an .app bundle to make a foreground-able app to solve your problem, but that's not a documented/intended usage of this function.
So, just wrap it in an .app bundle.
Update:
This "foreground-able-ness" is controlled by the activationPolicy of an app, see this doc on NSApplication. Found the info on this post on Cocoa with love.
I wrote a simple Mac 'Service' for Finder, that executes a command.
Basically: this adds a ContextMenu in Finder.
If I right-click a file in Finder, a menu item pops up. If the user clicks it, it executes my script. (kind of like 'Send to Bluetooth device, ...')
In OS X Leopard (10.5) and earlier, all services are enabled.
In 10.6 (Snow Leopard), Apple changed the behavior, services now have preferences, and can be enabled or disabled by the user. (which is a good thing)
However, I wrote the service, but there seems to be no way to enable it automatically (in our installer).
I tried doing it with Applescript, going to the System Preferences and ticking the checkbox that way, but it requires some accessibility features to be turned on. (off by default).
Is it possible? If so, how?
Or do I need something else to provide Context Menus in Finder.
I tracked File changes on my filesystem while changing the preferences and discovered there was a plist file:
~/Library/Prefrences/pbs.plist
which contains what I need.
If I edit that manually, it seems to work. So, problem solved :)