• 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
Sending non-string parameters to an AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sending non-string parameters to an AppleScript


  • Subject: Sending non-string parameters to an AppleScript
  • From: Jeremy Dronfield <email@hidden>
  • Date: Sun, 23 Jul 2006 15:58:41 +0100

I'm calling an AppleScript using NSAppleScript and NSAppleEventDescriptor. Part of the the purpose of the script is to set the positions of the icons in a Finder window. My problem is in working out how to pass a parameter (in this case a point) which isn't an NSString, since +[NSAppleEventDescriptor descriptorWithString:] seems to be the only way of passing an Obj-C data type. In desperation I've tried using:

[NSAppleEventDescriptor descriptorWithString:NSStringFromPoint (NSMakePoint(100, 100))]

and coercing the parameter to a point in the script with:

set position of item fileRef of windowRef to (newPosition as point)

but it doesn't work. I get an error: "{100, 100}" cannot be converted to type point. Surely it must be possible to pass a point (and other data types) to an AppleScript? If so, how?

Jeremy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Sending non-string parameters to an AppleScript
      • From: Mike Abdullah <email@hidden>
    • Re: Sending non-string parameters to an AppleScript [SOLVED]
      • From: Jeremy Dronfield <email@hidden>
  • Prev by Date: Re: attributedStringByTrimmingCharactersInSet: method?
  • Next by Date: NSArrayController subclass
  • Previous by thread: Re: Bindings, Dicts and Cancel Window
  • Next by thread: Re: Sending non-string parameters to an AppleScript [SOLVED]
  • Index(es):
    • Date
    • Thread