osx

How to read the background color of a cell through a (ruby) script from Microsoft Excel on Mac Osx?

I want to get the background color of a cell of an Excel worksheet. I have already tried the following: begin; require 'rubygems'; rescue LoadError; end require 'appscript' f = MacTypes::Alias.path(File.join(File.dirname(__FILE__), "planning.xls")) excel = Appscript.app("Microsoft Excel") excel.activate excel.open f w1 = excel.workshee...

Missing QMenuBar in Qt4 apps on OSX

My Qt4 apps with a QMenuBar show up fine under Linux and Windows, but will not display under OSX. I have a Xeon 64bit Mac Pro with OSX 10.5.7. I'm using Qt 4.5.2. I've tried building my apps with qmake -spec macx-g++ and using an xcode project. Neither seem to work. Any help is much appreciated. Thanks, Regis ...

Why use SysV or POSIX shared memory vs mmap()?

Needing to use IPC to pass large-ish amounts of data (200kb+) from a child process to a parent on OS X 10.4 and above, I read up on shared memory on Unix, specifically System V and POSIX shared memory mechanisms. Then I realized that mmap() can be used with the MAP_ANON and MAP_SHARED flags to do a similar thing (or just with the MAP_SH...

Using symbolic links inside OS X application bundles

Hi, I'm having a following problem. I have a bundle that has the following structure: B.app/Contents/Frameworks -> link to an existing FS location [1] B.app/Contents/Info.plist B.app/Contents/MacOS B.app/Contents/MacOS/AliasBinary -> link to an existing binary called ExistingBinary [2] B.app/Contents/Resources -> link to an existing F...

From PC to Mac - Good or bad move for my programming career?

Here's the deal: I have both a last gen Unibody Macbook Pro 15" (base) and a ThinkPad T500 sitting in front of me (don't ask). The Macbook Pro is beautiful and OS X appears to be very interesting. However, my tool set lies within Windows - Visual Studio, VB.NET, C#, ASP.NET, etc. I'm really torn on this potential decision. Part of ...

What's the equivalent of SHGetFolderPath on OSX?

I am porting a Windows application to OSX and need to get user's home, documents and music directories. It is done on Windows using a SHGetFolderPath WinAPI call. How can I do it in OSX, preferably without resorting to Objective C? If I can't do it without Objective C, how can I do it at all? ...

CATextLayer outlined text

How do I draw outlined text using Core Animation layers? The stroke attributes of an NSAttributedString seem to get ignored by CATextLayer and I can't find a standard filter that I can apply to the layer that gives good results. Surely this should be easy? ...

How to call Apple Authorization API from PyQt4

I am currently working on a PyQt4 app which requires administrator privileges to access some files. I would like it to follow Apple guidelines and open the Authenticate Dialog to prompt the user to input their password in order to perform administrator tasks. I have already looked into MacPython Authorization package, but it seems a bit...

easy, programmable data plotting

Hi all, I spend most of my time plotting data, but unfortunately I haven't found a decent solution for my plotting needs. At the moment, the most powerful and pleasant library I found that performs plotting is matplotlib. The results are stunning, but I mostly spend my time fighting with the library when trying to do simple things like...

How to emulate 'cp --update' behavior on Mac OS X?

The GNU/Linux version of cp has a nice --update flag: -u, --update copy only when the SOURCE file is newer than the destination file or when the destination file is missing The Mac OS X version of cp lacks this flag. What is the best way to get the behavior of cp --update by using built-in system command line programs? I want ...

Modal JDialog on Mac OSX freezes?

I have a modal JDialog pop up to get some user input in my app. I start a new thread and put setVisible to true after the JDialog is constructed. I can see in debug the last breakpoint hit is when the setVisible property is set. The code does indeed stop due to the modal setting waiting for this JDialog to close, but after a few seconds ...

How do I receive SNMP traps on OS X?

I need to receive and parse some SNMP traps (messages) and I would appreciate any advice on getting the code I have working on my OS X machine. I have been given some Java code that runs on Windows with net-snmp. I'd like to either get the Java code running on my development machine or whip up some Python code to do the same. I was able...

How can I send a HTML email from Cocoa?

I'm looking for a way to create a HTML formatted email from a OS X Cocoa application. My preferred workflow would be: The user selects a menu item and the default mail application opens with a pre-filled new email in the foreground. I'm able to do this with mailto and -[NSWorkspace openURL] for plain text emails, but this doesn't work ...

Installing debug version of Qt on Mac OSX

I need to step through the Qt code to help solve a bug in my C++ application. I've downloaded qt-mac-opensource-src-4.5.2.tar from here and followed the install instructions that came with this: unpacked the file to /tmp. typed ./configure -debug. typed make. typed sudo make install. edited the PATH environment variable as instructed. ...

Simulate USB insertion on OSX via software

How can I inject USB device nodes into OSX (>= 10.5) such as you might be able for debugging USB handlers / writing new USB drivers? I'm interested in this in order to handle non-USB devices using TokenD. From what it looks like, I would have to tackle faking USB-device insertion and then create a PC/SC ifdHandler that would handle thi...

Find Active Directory users home folder from login hook script in OS X

I need to write a OS X login hook script that is aware of the users current home folder. Since the users are Active Directory users, their home folders are not stored in /Users so I can't simply hard code the full path. Since the login hook is run by a daemon as root, I can not use $HOME, ~, etc either. The only piece of info I have i...

Is the file hidden?

How can I determine whether a certain path points to a hidden file/folder? NSString *file = @"/my/file/some.where"; BOOL fileIsHidden = // <-- what do I do here? I know that hidden files are prefixed by a period. This is not the only criteria for a file to be hidden. I've read somewhere that there's a .hidden file that also configures...

How can a Windows programmer be sufficiently productive on Mac OS X?

I've been using MacBook Pro for a few months at home, and I was wondering if there's a good book or guide that can help me be a better programmer on Mac. Maybe Mac-equivalent of Beginning Linux Programming. Note I am not looking for resource on how to program Mac application, instead I am looking for more general guide of using Mac for g...

Install sqlite3 on mac osx?

I just bought a new MBP I've read online Sqlite3 already exists on OSX. I've downloaded mac ports (and installed it) as well as the bin file for sqlite3 from the official web site. In a guide I'm reading about rails, which tells me to update sqlite3, I run the following in terminal: sudo port upgrade sqlite3 I receive the following ...

Access file type icons Mac OSX

I am trying to find a way to access the Mac OSX system icons. Does anyone know their default location on a Mac? Or know of a way using Java to have them returned? There is a method of using JFileChooser for Mac to retrieve an Icon for a file, but the file has to exist on the file system (in my app the file could be streaming from a serv...