• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 'Mail' menu won't activate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'Mail' menu won't activate


  • Subject: Re: 'Mail' menu won't activate
  • From: Brian Christmas <email@hidden>
  • Date: Sat, 13 Dec 2014 12:26:08 +1100


G’day again

I decided that what I needed as a remedy for my dilemma of Mail not clickable, was to click on the desktop at the position of the required item. Easier said than done.

I found a page that described how do do this via an .h file, but when I compiled the attached file, it gave me an error and a warning. Also, I have no idea of where any compiled file might be located.

As I  know nothing about the terminal commands, would someone who know about such things be able to guide me on what I need to do please.

The page is a MacWorlds page here.

The page contents and Terminal command are below. You need to save the contents to a text file rename ‘Click.m’, and also navigate to the file with the Terminal.

Regards

Santa

Command…

gcc -o click click.m -framework ApplicationServices -framework Foundation


Contents…

{\rtf1\ansi\ansicpg1252\cocoartf1343\cocoasubrtf160
{\fonttbl\f0\fnil\fcharset0 Monaco;\f1\fnil\fcharset0 Verdana;}
{\colortbl;\red255\green255\blue255;\red140\green30\blue3;\red0\green0\blue38;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\qj

\f0\fs24 \cf2 \expnd0\expndtw0\kerning0
// File: \
// click.m\
//\
// Compile with: \
// gcc -o click click.m -framework ApplicationServices -framework Foundation\
//\
// Usage:\
// ./click -x pixels -y pixels \
// At the given coordinates it will click and release.\
\
\
#import <Foundation/Foundation.h>\
#import <ApplicationServices/ApplicationServices.h>\
\
\
int main(int argc, char *argv[]) \{\
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\
  NSUserDefaults *args = [NSUserDefaults standardUserDefaults];\
\
\
  // grabs command line arguments -x and -y\
  //\
  int x = [args integerForKey:@"x"];\
  int y = [args integerForKey:@"y"];\
\
\
  // 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.\
  //\
  CGPostMouseEvent( pt, 1, 1, 1 );\
  CGPostMouseEvent( pt, 1, 1, 0 );\
\
\
  [pool release];\
  return 0;\
\}\
\pard\pardeftab720

\f1 \cf3 \expnd0\expndtw0\kerning0
Save the above code as 
\f0 \cf2 \expnd0\expndtw0\kerning0
click.m
\f1 \cf3 \expnd0\expndtw0\kerning0
, open Terminal, and switch to the folder where you saved the source. Then compile the program by typing 
\f0 \cf2 \expnd0\expndtw0\kerning0
gcc -o click click.m -framework ApplicationServices -framework Foundation
\f1 \cf3 \expnd0\expndtw0\kerning0
. Don't be intimidated by needing to compile this as there are more comments than code. It is a very short program that does one simple task. \cf0 \expnd0\expndtw0\kerning0
\
}
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >'Mail' menu won't activate (From: Brian Christmas <email@hidden>)

  • Prev by Date: Requesting assistance with 'Mail' app
  • Next by Date: Re: Requesting assistance with 'Mail' app
  • Previous by thread: 'Mail' menu won't activate
  • Next by thread: Requesting assistance with 'Mail' app
  • Index(es):
    • Date
    • Thread