<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Personal website of Dave Hope &#187; OSX</title>
	<atom:link href="http://davehope.co.uk/Blog/tag/osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://davehope.co.uk</link>
	<description>Open source projects, sysadmin stuff and general geekage</description>
	<lastBuildDate>Tue, 18 May 2010 11:46:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Prevent .DS_Store creation on network shares</title>
		<link>http://davehope.co.uk/Blog/prevent-ds_store-creation-on-network-shares/</link>
		<comments>http://davehope.co.uk/Blog/prevent-ds_store-creation-on-network-shares/#comments</comments>
		<pubDate>Wed, 06 May 2009 19:15:23 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://davehope.co.uk/?p=253</guid>
		<description><![CDATA[At home I have a HTPC with some SMB shares for Music and Videos. Much to my annoyance my beloved macbook insisted on creating .DS_Store files on these shares whenever I used them. That is, until I found out how to prevent it doing so. Open Terminal.app, type the following and hit return defaults write [...]]]></description>
			<content:encoded><![CDATA[<p>At home I have a HTPC with some SMB shares for Music and Videos. Much to my annoyance my beloved macbook insisted on creating .DS_Store files on these shares whenever I used them. That is, until I found out how to prevent it doing so.</p>
<p>Open Terminal.app, type the following and hit return</p>
<p><code>defaults write com.apple.desktopservices DSDontWriteNetworkStores true</code></p>
<p>Ahh, much better.<br />
<span id="more-253"></span></p>
<div class="sponsoredWords">Before you start your certification career, analyze the job marketplace and decided to obtain the most important and popular certification credentials. We analyzed that the candidate having certifications EMC <a href="http://www.testking.com/E20-540.htm">E20-540</a> Networked Storage, HP StorageWorks <a href="http://www.testking.com/HP0-J15.htm">HP0-J15</a> and HP Certification <a href="http://www.testking.com/HP0-Y20.htm">HP0-Y20</a> exam are considered the highly qualified. All Microsoft’s exams including  <a href="http://www.testking.com/MB2-632.htm">MB2-632</a> CRM 4.0 Applications, <a href="http://www.testking.com/70-315.htm">mcad 70-315</a> Web applications with Visual C# and Visual Studio and <a href="http://www.testking.com/70-272.htm">mcdst 70-272</a> carry the highest value on business market.</div>
]]></content:encoded>
			<wfw:commentRss>http://davehope.co.uk/Blog/prevent-ds_store-creation-on-network-shares/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX Click the mouse via code</title>
		<link>http://davehope.co.uk/Blog/osx-click-the-mouse-via-code/</link>
		<comments>http://davehope.co.uk/Blog/osx-click-the-mouse-via-code/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 09:58:22 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://davehope.co.uk/?p=203</guid>
		<description><![CDATA[A few weeks ago I needed to be able to click the mouse via code on my MacBook. After some digging I came across this article, which provided some useful basic code. I quickly got fed up of having to work out the screen coordinates so have extended the application to use the current coordinates [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I needed to be able to click the mouse via code on my MacBook. After some digging I came across <a href="http://www.macosxhints.com/article.php?story=2008051406323031">this article</a>, which provided some useful basic code.</p>
<p>I quickly got fed up of having to work out the screen coordinates so have extended the application to use the current coordinates of the mouse. Here&#8217;s the code.</p>
<pre>// File:
// click.m
//
// Compile with:
// gcc -o click click.m -framework ApplicationServices -framework Foundation -framework AppKit
//
// Usage:
// ./click -x pixels -y pixels -clicks Number Of Clicks - interval wait between clicks
// At the given coordinates it will click and release.

#import &lt;Foundation/Foundation.h&gt;
#import &lt;ApplicationServices/ApplicationServices.h&gt;

int main(int argc, char *argv[])
{
NSAutoreleasePool *pool    = [[NSAutoreleasePool alloc] init];
NSUserDefaults *args    = [NSUserDefaults standardUserDefaults];

// Wait 5 seconds before getting the mouse location, give
// the user a chance.
sleep(5);

// Grabs command line arguments -x, -y, -clicks, -interval.
// If not set, it'll use the current mouse location for coordinates
// and 1 for the click count and interval.
int x        = [args integerForKey:@"x"];
int y        = [args integerForKey:@"y"];
int clicks    =    [args integerForKey:@"clicks"];
int interval=    [args integerForKey:@"interval"];
if (x == 0 || y == 0)
{

CGEventRef ourEvent = CGEventCreate(NULL);
CGPoint ourLoc = CGEventGetLocation(ourEvent);

x = ourLoc.x;
y = ourLoc.y;

}
if (clicks == 0)
{
clicks = 1;
}
if (interval == 0)
{
interval = 1;
}

// The data structure CGPoint represents a point in a two-dimensional
// coordinate system.  Here, X and Y distance from upper left, in pixels.
CGPoint pt;
pt.x    = x;
pt.y    = y;

// This is where the magic happens.  See CGRemoteOperation.h for details.
//
// CGPostMouseEvent( CGPoint        mouseCursorPosition,
//                   boolean_t      updateMouseCursorPosition,
//                   CGButtonCount  buttonCount,
//                   boolean_t      mouseButtonDown, ... )
//
// So, we feed coordinates to CGPostMouseEvent, put the mouse there,
// then click and release.
//
int i = 0;
for (i = 0; i &lt; clicks; i++ )
{
CGPostMouseEvent( pt, 1, 1, 1 );
CGPostMouseEvent( pt, 1, 1, 0 );

// Wait interval.
sleep (interval);
}

[pool release];
return 0;
}</pre>
<p>You&#8217;ll need XCode installed to build it (if you&#8217;re desperate for a binary, drop me an e-mail). You can then run with -clicks 375 -interval 4, you then have 5 seconds to place your mouse on the area of the screen where it&#8217;ll click.</p>
]]></content:encoded>
			<wfw:commentRss>http://davehope.co.uk/Blog/osx-click-the-mouse-via-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
