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

Re: Passing variables from one script to another


  • Subject: Re: Passing variables from one script to another
  • From: Craig Williams <email@hidden>
  • Date: Mon, 11 Jul 2011 10:23:18 -0600

Example application.
https://github.com/CraigWilliams/DragDrop



On Jul 11, 2011, at 9:32 AM, Evan Schoffstall wrote:

It logs successfully but when I try

set fileContent to pathtoPicture() as text

somewhere else in the script the debugger logs: "
No result was returned from some part of this _expression_. (error -2763)"
I don't understand.. It's obviously not saving and I'm not sure how loging the pathtoPicture was supposed to save the pathtoPicture.
-- 
Evan Schoffstall
Sent with Sparrow

On Monday, July 11, 2011 at 12:18 AM, Craig Williams wrote:

When the application loads, the app delegate is created and pathToPicture is missing value.
When you drag an image into the image well, the path is being set but you are not retrieving its value.

Add this to the app delegate.
on logPathToPic()
    log pathtoPicture()
end logPathToPic

And this in the myImageWellScript
tell current application's NSApp's delegate() to setPathtoPicture_(theFiles)
tell current application's NSApp's delegate() to logPathToPic()

hth,

Craig

On Jul 10, 2011, at 9:25 PM, Evan Schoffstall wrote:

Okay Scratch my last email. I apologize if any of you read it in-between the time I sent it about 25 minutes ago.
I am still getting a missing value for pathtoPicture with the following code


property parent : class "NSObject"

property pathtoPicture : missing value

on start()

log pathtoPicture --returns missing value

end start





end script



script myImageWellScript
    
property parent : class "NSImageView"
    
    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)
        tell current application's NSApp's delegate() to setPathtoPicture_(theFiles)
        return true -- otherwise it doesn't happen
    end performDragOperation_

end script



-- 
Evan Schoffstall
Sent with Sparrow

On Sunday, July 10, 2011 at 7:25 PM, Shane Stanley wrote:




 _______________________________________________
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: 
 >Re: Passing variables from one script to another (From: Shane Stanley <email@hidden>)
 >Re: Passing variables from one script to another (From: Evan Schoffstall <email@hidden>)
 >Re: Passing variables from one script to another (From: Craig Williams <email@hidden>)
 >Re: Passing variables from one script to another (From: Evan Schoffstall <email@hidden>)

  • Prev by Date: Re: Passing variables from one script to another
  • Next by Date: Re: Table double click action
  • Previous by thread: Re: Passing variables from one script to another
  • Next by thread: Table double click action
  • Index(es):
    • Date
    • Thread