• 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
Passing variables from one script to another
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing variables from one script to another


  • Subject: Passing variables from one script to another
  • From: Evan Schoffstall <email@hidden>
  • Date: Sun, 10 Jul 2011 16:07:52 -0400

I understand that there was a previous email about this as well as a post in MacScript(er? ar?) too however, I am dealing with separate ASOC issues and might have not fully comprehended the prior resources.
Anyway, on to the actual issues.

I have two scripts. The first is my controller of which I want everything thrown into. The second is a subclass of "NSImageView" of which I have a performDragOperation_(sender) *function* (wrong terminology? Am I thinking C?). I want a variable that I set from performDragOperation in myImageWellScript to another function in myAppDelegate.

Note that I do not want to call performDragOperation like so: "tell class 'myImageWellScript' of current application to performDragOperation_(me)" because it is part of the API and has a right to complain of errors.

myImageWellScript:

  on performDragOperation_(sender)

        -- Get the file path

        set pb to sender's draggingPasteboard()

        set theFiles to pb's propertyListForType_("NSFilenamesPboardType")

        set filePath to item 1 of (theFiles as list)

        log theFiles as text

        return true -- otherwise it doesn't happen

    end performDragOperation_


I want the variable theFiles to be sent to myAppDelegate.
I tried a few things all of which failed.

set pathtoPicture to class "myImageWellScript"'s theFiles

tell class "myImageWellScript" of current application to set pathtoPicture to myImageWellScript's theFiles

tell class "myImageWellScript" of current application to set performDragOperation_(me)

tell class "myImageWellScript" of current application to set pathtoPicture to performDragOperation_(me)'s theFiles


I would absolutely love any help that any of you could provide. 

-- 
Evan Schoffstall
Sent with Sparrow
 _______________________________________________
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

  • Follow-Ups:
    • Re: Passing variables from one script to another
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: ApplescriptObjC NSNotifications
  • Next by Date: Re: Passing variables from one script to another
  • Previous by thread: Re: ApplescriptObjC NSNotifications
  • Next by thread: Re: Passing variables from one script to another
  • Index(es):
    • Date
    • Thread