osx

finding the app window currently in focus on Mac OSX

I am writing a desktop usage statistics app. It runs a background daemon which wakes up at regular intervals, finds the name of the application window currently in focus and logs that data in database. I manage to do this on Linux desktop with help of xprop utility (you can find it here). How can I do the same on Mac OSX? Is there a d...

handling login authentication with ajax for OSX dashboard widget?

I'm wanting to build a simple OSX dashboard widget to tie in with my web application. The widget will need a login screen first (user and password) to use it though (checked against user table in hosted mysql database, password stored SHA1 encrypted) So my thought is that the widget will need to: show username and password fields Pas...

Decoding integer and other masks in Cocoa

Cocoa has a plethora of integer masks and codes. For instance, NSCommandKeyMask or NSF1FunctionKey, which are clearly defined and documented in the headers. However, some can be archaic and when accessing accessibility attributes, for instance to get the glyph (AXMenuItemCmdGlyph), you're given an integer number like 111, which represen...

How to install OpenCV for python

HI! I'm trying to install opencv and use it with python, but when I compile it I get no errors but I can't import cv module from python: patrick:release patrick$ python Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>...

What is a MIG subsystem and can anyone give an example of creating one?

I've been looking at Mac OS Architecture and I found something refereed to as MIG. I think it is used for inter process communications but I'd like to find out more. Can someone tell me more about MIG (and what it stands for) ? Here is a strucure of a 'defs' file: subsystem example 36270; #include <mach/std_types.defs> routine mig_t...

Running OSX MAMP test server on VirtualBox Windows 7

I have MAMP server and several test sites installed on my OSX 10.6.3. I just installed Windows 7 on a VirtualBox virtual machine. I have managed to successfully share folders to the Windows installation, but I am wondering if I can run my MAMP sites in Windows without installing a different Localhost there. Does anyone know if this is p...

OSX Custom extension icon Association

I'm trying to get my application to display an icon for a custom file extension using the following code: <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>My Custom Extension</string> <key>CFBundleTypeRole</key> <string>Viewer</string> <...

How to nuke all Ruby Gems from the system and start over

What's the easiest way to start over with Ruby Gems? I have Ruby 1.8.7 (OSX, ports) installed and I have also installed rails and some other random stuff a while back. Now the gems system seems to be totally dysfunctional and I can't upgrade rails. So is there a way to just nuke the gems so I can reinstall all this stuff with current ver...

How do I solve this "Can't continue count" problem in an AppleScript app that deals with parameters?

I'm trying out a simple AppleScript I found online: on run argv set rtn to ((count of argv) as text) & " parameters passed. The parameters were: " repeat with arg in argv set rtn to rtn & " " & (arg as text) & " " end repeat return rtn end run I saved it as an Application. Everytime I double click it from the Finder, I get...

Bus error on OSX - pthreads

Hi, am trying to get my head around the following: Have a small program am trying to port to OSX(intel) which calls function doWork() via pthread_create, in the function, I start by creating an array of long like such: long myarray[DIMENSION] on OSX, for the following values of DIMENSION, I get the following: 0->65434 = fine 6543...

custom list control in cocoa

Hello, I am trying to get something like in this screenshot in cocoa, I mean a custom list control. Do you know how this kind of things can be done? Thanks in advance for your help, Regards, ...

get app icon from window id in cocoa

I am looking for a way to get the application icon from a window id in cocoa. Do you have any pointer for this? ...

What is different between Ruby in standard OS X distribution, RVM and MacPorts?

I have asked a question on SuperUser about updating Ruby version in Google SketchUp. It seems that there is something different between Ruby shipped with the standard OS X distribution, and Ruby installed by RVM or MacPorts. I get the following error message when I try to use RVM's or MacPorts' Ruby 1.9.1 Exception Type: EXC_BREAKPOINT...

Editing large number of text files

I have about 350 text files which comprise the entire contents of 5 folders on my HD. For each of these files, I would like to delete a specified number of characters at the start and end of each file. I have no knowledge of AppleScript but suspect it may be suitable for what I want to achieve. Any help on automating this would be greatl...

old rsync and spaces in filenames

Source directory is determined like so: SHOW=${PWD##*/} [email protected]:"/mnt/bigfish/video/TV/${SHOW}/" So it comes out something like: [email protected]:/mnt/bigfish/video/TV/The Name Of the Show With Spaces/ Then trying to run rsync like so: rsync -avz -e ssh "${SRC}" . But it tells me that ""/mnt/bigfish/video/TV/The" is...

Cocoa - Force Quit all other applications

Is there a way to force quit all other applications from a cocoa app? If it kills the app itself if doesn't matter It supposed to quit too. It has to be force quit since i dont want any dialogue boxes about saving or anything poping up. Thanks! and cocoa as in desktop osx. NOT iPhone. ...

Recommended document structure. File Wrappers? Roll my own?

Hi, I'm currently working out the best structure for a document I'm trying to create. The document is basically a core data document that uses sqlite as its store, but uses the Apple provided NSPersistentDocument+FileWrapperSupport to enable file wrapper support. The document makes heavy use of media, such as images, videos, audio files...

Converting signal to NSException only work the first time

It seems that when BSD signals are converted to thrown exceptions, it only work the first time but not subsequent times. I tried to convert signals to exception via the following call I made in the main method just before calling NSApplicationMain : [[NSExceptionHandler defaultExceptionHandler] setExceptionHandlingMask:NSHandleUncaught...

Going fullscreen in an itunes like application (cocoa OSX)

I have a cocoa application that has a finder like feel it and is made up of five views. On the left there is a gallery which is a finder like interface to choose a given object. This view stretches across the whole height of the window. Then on the right I have a window for a 3D simulation view and then below it I have three editing v...

Does JavaFX work in 32-bit Windows? (or with a 32-bit JVM)?

Hello, Since JavaFX only works for 64-bit Linux and 64-bit OS X as far as I know (because the newer verison of Java hasn't been released in 32-bit), I'm curious if JavaFX is able to work on 32-bit Windows. Any thoughts? Thanks! ...