osx

Append a folder name to a path variable in applescript?

set fold to "/Users/Test/Desktop/" set file to "/Myfolder/Hi.txt" how to join these two variables to get my file path as "/Users/Test/Desktop//Myfolder/Hi.txt"? ...

Image in bundle not found using NSBundle

Hey internets! So here's the deal: I have an image in the Resources folder of custom framework that I use as a default for classes in the framework. However, when I create these classes in projects that link against my framework they fail saying they can't find the image. I'm guessing the NSBundle's +mainBundle does not search the cor...

Cocoa NSTabView coding style question

Hello, I have a coding style question which probably should be asked of a senior mac programmer at work - but since I'm the only mac programmer, well, SO it is. I have a pop-up GUI for my software (3D models, data visualization) and the pop-up is Mainly a Tabbed control with a ton of stuff in each tab (sliders, radio buttons, checkboxe...

Setting default application for given file extension on MacOSX from code

I have the list of the applications for given file extension (using LSCopyApplicationURLsForURL). I want to change the default file association from code upon selecting one of the applications from the above call. Is there a way to do this? Thanks! ...

Delete line ending with a newline character in text file

I need to delete the same line in a large number of text files. I have been trying to use sed, but I cannot get it to delete the newline character at the end. The following successfully deletes the line, but not the newline: sed -i -e 's/VERSION:1//' *.txt I have tried using the following to delete the newline also, but it does not wo...

NSMenuItem -setTarget: Does it retain the target?

NSMenuItem -setTarget: Does it retain the target, or should one explicitly retain it? I've seen conflicting docs on this. I know of retainArguments in NSInvocation, but I'm not sure this applies to NSMenuItem as it doesn't inherit from NSInvocation. ...

NSOutlineView titles are blank

I am working on an NSOutlineView that I populate by bindings to an NSTreeController. The NSTreeController contains objects of my own type. Everything is working as expected (getting the correct number of rows and disclosure indicators in the right places) expect that the titles for each row are coming up blank. I have overridden -(NSSt...

How can I replace a Python 2.65 UCS-2 build with one built using UCS-4 without losing everything in my site-packages?

I downloaded the Python 2.6.5 source, built it for OS 10.6.4 64-bit, and installed numerous dependencies. I opened a big project our team has been working on recently, ran the unit tests, and one of the tests failed because I had installed Python built using UCS-2 (I didn't know this was the default of OS X!) In a nutshell: I didn't sup...

Code Snippet Managers for OS X?

What are some good code snippet managers for OS X? ...

How to compile universal libraries on Mac OS X?

This may be a very silly question, but I'm new to developing on Macs and am having a hard time with the universal binaries. I've got an application that I'm compiling in QT Creator, which according to lipo is producing i386 architecture outputs. As I understand it, that means it is producing Mac OS X 32 bit outputs. The application dep...

How to export symbols in dylib release in xCode 3.2.3 (GCC 4.2)

All symbols where exported in previous version of xcode but now we have upgraded to OS X 10.6.4 and xcode 3.2.3. So, in debug xcode property Fix & Continue is enabled which causes all symbols to export but in release its disabled and now while linking to this dylib we get undefined symbol error. I tried to add exported symbol file but do...

How can I access the mysql command line tool when using XAMPP in OS X?

I've got a vanilla install of XAMPP in OS X. How can I access the mysql command line tool? I've tried typing "mysql" at the command line, and it spits back "-bash: mysql: command not found". ...

KVO problem "Cannot remove an observer"

I have an NSArrayController linked to a Core Data object, set to Auto Rearrange Content and filtered by a predicate. All is well until I try to nullify a relationship and assign another. At that point, my application crashes and I receive the following error: Cannot remove an observer for the key path "career.type" from Object...

triggering kevent by force

Hi everyone, I'm using kqueue for socket synchronization in OS X. I can register an event of interest like the following: struct kevent change; EV_SET(&change, connected_socket, EVFILT_READ, EV_ADD, 0, NULL, NULL); kevent(k_queue_, &change, 1, NULL, 0, NULL); And the question is, is there a way to trigger this event by force so that ...

How to change transparency of X11 window under Mac OS X (Xquartz)?

XChangeProperty() with atom named _NET_WM_WINDOW_OPACITY returns BadRequest error code... ...

Swing: Steal focus from other apps (usability in OS X)

I have an application in java swing which runs in the system tray most of the time. The user can use the Tray Menu to perform several actions. One of those actions is to show the app window. The problem I have is with usability on OS X. In windows, if the user brings up the app window and later switches to another app, they can switch b...

Programmatically run at startup on Mac OS X?

How do I programmatically set an application bundle on Mac OS X to run when the user logs in? Basically, the equivalent of the HKCU\Software\Microsoft\Windows\CurrentVersion\Run registry key in Windows. ...

kind of NSMouseEntered for a region belonging to the desktop in cocoa

Hello, I would like to be notified when the mouse cursor enters in a particular region of the screen and stays there a certain time. I know there is NSMouseEntered & cie for view you are owning, but is there something more generic which works in all the screen? Thanks and regards, ...

How to install pangocairo with python bindings on 32bit OSX 10.6

I'm having difficulties building the pangocairo bindings on my OSX 10.6 machine and would like to know how to proceed. To sketch the background, I'm writing a wxwindows application in Python with wxpython that draws on a cairo canvas. I have been able to compile all dependencies for this with the extra difficulty that I need 32bit (inst...

OS X: how to define the order of the NSServices provided by an application

We have defined a couple of NSServices for the same NSSendFileTypes in our application's Info.plist. Unfortunately, they occur in a different order than defined when they show up in the context menu. Is it possible to tell OS X to keep the order as defined? ...