osx

Get total system memory without external tools

To get total installed RAM I can use popen("sysctl -n hw.memsize", "r"), but is there some library to get this info without running external tools? ...

Need help tracking down USB error

Currently I have an objective-C program that detects when a Fujitsu scanner is added and removed from the computer. I'm trying to add the ability to ask the scanner information about itself. I know the command for this, however, something is going wrong. I'm doing a bit of cargo-cult programming, from two different cargo cults (How do yo...

Mac OS X File / Folder Management: When to Copy instead of Move

The Finder uses some kind of rules to determine if an Item can be moved or will be copied. After dragging an Item, in certain cases Finder shows a drag-copy-cursor. Are these rules in an API available? Checked with Spotlight-Metadata, NSURL and NSFileManager: no result. Here's what i came up with: if a Folder contains a ".localized"...

How to draw a highlight around mouse cursor

I'd like to be able to display a quick animated "flash" around the mouse cursor (similar to the effect in some screen-recording applications). What would be a good way to go about this? My current idea is to display a temporary, floating, transparent window window under the mouse position, animate it, then hide it. But I'm wondering if ...

Video capture filter

How I can filter video stream from camera in MacOS X. I write quicktime sequence grabber channel component, but it`s work only if app used SG API. If app used QTKit Capture the component is not worked. Somebody know how I can implement it? ...

How to get and set the wallpaper in objective c on Mac OSX?

I am looking for a way to get (and set) the wallpaper in objective c under Mac OS X. Do you have code/pointer for this? Thanks in advance for your help. ...

CGSSetWindowWarp not working in 64 bits apps

Hello, I am developping a Mac OS X app using the undocummented CGSSetWindowWarp function. Everything is ok when compiing in 32 bits but it stop to work (window dissapear completly) when compiling in 64 bits. Do you have any idée where the issue can be? Thanks in advance for your help Regards, ...

How to compile an OSX Cocoa framework from code in an iPhone project?

This question comes from this other one I asked earlier: http://stackoverflow.com/questions/3180574/calling-custom-objective-c-from-a-pyobjc-application I want to re-use a small part of the app logic from my iPhone app in its server-side component, which runs on OSX. Based on what I was told in the other question, it looks like I need ...

How do I package my unix builds as a Mac .pkg installer

So I built my ruby 1.9, mysql, postgres, lighttpd, gems and other libs now I want to make it as package to install on other machines. Just how do I do this with Apple PackagerMaker and have it install in the right folders on the machine. I want to get it done soon to install on all the lab computers. ...

How can I install Apache Ant on Mac OS X ?

Hi guys, I tried to install Apache Ant on my Mac and I followed the next steps : I Downloaded apache-ant-1.8.1-bin.tar.gz into my Downloads folder. I moved the file to /usr/local/ using this commands : sudo sh and mv apache-ant-1.8.1-bin.tar.gz /usr/local/ Now I want to use cd /usr/local/ but it's not working, I get back "No such file ...

wxPython on Mac OS X: creating a wx.Frame without stealing focus

I managed to get it working on Win32 (inheriting from wx.MiniFrame does the trick), on wxGTK (wx.PopupWindow) but whatever I try, when I create a frame on wxMac, my main window loses focus and the new frame gets it. wxMac does not seem to have a way to interact with the native platform (something like GetHandle() on Win32 and GetGTKWidg...

NSWindows receiving mouse events without taking focus

Hello, I am trying to create a NSWindow derived window which look likes a callout window and having teh following features: - can be placed everywhere on the screen - shouln't take the focuse of the currently focused window when bringed to front - have to reveive mouse events How should I do this? Thanks and regards, ...

Atomic load/store for OSs other than BSD?

Among the atomic operations provided by BSD (as given on the atomic(9) man page), there are atomic_load_acq_int() and atomic_store_rel_int(). In looking for the equivalent for other OSs (for example, by reading the atomic(3) man page for Mac OS X, the atomic_ops(3C) man page for Solaris, and the Interlocked*() functions for Windows), th...

How to close or minimize browser windows with Selenium RC?

Every time I launch a Firefox instance via Selenium RC I get 3 windows that I don't need appearing: the add-ons windows notifying me that "3 new add-ons have been installed" (since I'm using a custom profile for Selenium to which it evidently adds the DocumentReadyState, KillFF, and Selenium RC Runner add-ons) the http://localhost:4444...

Automate Spreadsheet Transformations

Hello, Every month I process a vendor's MS Excel spreadsheet for my work. I have to remove columns, rename columns, re-format columns, and then email the resulting spreadsheet to colleagues. Is there a way, in Excel or Numbers or programmatically, to automate this extremely repetitive process? Thanks, Sergio ...

Observe other application quit or sudden termination in cocoa app

I need to create wrapper around application, so I created little cocoa app that opens application with [[NSWorkspace sharedWorkspace] launchApplication:…], can I register some event when that application quits or terminates (I certainly need to get event if app is finished good or bad way). I know that I can ask if such application is ru...

What is the required DataFlavor to copy files in Mac OSX

I'm currently working on Java code that can copy files into the system clipboard. For Windows and Linux I already got it working. For OSX I tried several flavors but the "Paste" action in Finder never cames active. Any idea which DataFlavor settings are required for Finder? Used flavors: DataFlavor.javaFileListFlavor URILIST_FLAVOR =...

AJAX Push Engine: Can’t contact APE Server.

I'm trying to set up the AJAX Push Engine (APE) on my Mac, running Mac OS X 10.6.4 and Apache 2.2.14 When I run the APE server, this is the output: Hristo$ sudo ./aped Password: _ ___ ___ /_\ | _ \ __| / _ \| _/ _| /_/ \_\_| |___| AJAX Push Engine Bind on port 6969 Version : 1.00 Build : Dec 7 2009 23:05:18 Author : We...

Non-interactive ploting with matplotlib on Mac OS X

I am using scipy-cluster in my application. It provides a function to plot a dendrogram of the hierarchical cluster tree. Looking at the source I find that it eventually plots the dendrogram by calling draw_if_interactive. As one would expect, this works fine in an interactive session, but when I run the script non-interactively, a windo...

How do I find the base address and size of the stack on MacOS X?

I'm porting an imprecise garbage collector from Windows to MacOS X. In it, it has to scan the stack to identify potential pointers into the heap, and then use those as GC roots. To do this, I need the stack's base as well as it's length. In Windows, this code uses an algorithm similar to what's described here: http://stackoverflow.com/...