• 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: Add Droplet functionality to Applet...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add Droplet functionality to Applet...


  • Subject: Re: Add Droplet functionality to Applet...
  • From: Matthew Broms <email@hidden>
  • Date: Mon, 05 Jan 2004 16:20:23 -0500

Dratz, dratz, DRATZ! I was sure your advice was right on the money, Tim
(thanks), something I had definitely missed. But alas, still no worky.
This is really driving me nuts - something so seemingly simple taking a day
to figure out. At this point it would be easier to just start a new droplet
(that I know will work) and copy over all my code, but I don't know how to
move my MainMenu.nib file over to a new project with all the hook-ups being
correct (don9t' want to redesign it). <end venting>

I turned this on as described, recompiled, and no go (I figured you meant
'not'). Then I turned it off, deleted the 'on open' and 'on idle' handlers
I had created prior, saved everything, then went back and turned on the
'open' and the 'idle' knowing that it would auto-enter the code it wants
into my script, and added the inside code so it all looks like this now:

on open theObject
display dialog "theObject: " & theObject as string
processUpdates(these_items)
end open

-- I assume I don't need this, but put it here just in case it was
-- required (a desparate effort) since the Assistant sets you up with one
-- when creating a droplet.
on idle theObject
display dialog "I am idle"
end idle

on processUpdates(theFilePath)
display dialog "I'm updating --> theFilePath = " & theFilePath as string
end processUpdates

I saved everything and even did a 'Clean All Targets'. Despite all of this,
I cannot drag a file onto the newly compiled applet and have it highlight
(indicating it will launch with that item). The icon doesn't show the down
arrow either. The only thing I can think of is that I created this
original project in Xcode 1.x or that the 'on launch' causes some sort of
conflict?

Something I notice too is that instead of 'on open these_items' as I'm quite
use to seeing, Xcode enters it as 'on open theObject'. If I could get it
running, I could figure out the differences.

FYI - I'm on Panther 10.3.1 using AS 1.9.3 and Xcode v1.1.

Matt

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


> From: Tim Bumgarner <email@hidden>
> Date: Mon, 5 Jan 2004 14:54:44 -0500
> To: Matthew Broms <email@hidden>
> Cc: AppleScript-Users list <email@hidden>
> Subject: Re: Add Droplet functionality to Applet...
>
> Hi Matthew,
>
> You need to make sure you open your MainMenu.nib, select the File's
> Owner icon (which represents the application) and go to the AppleScript
> inspector panel and check the "open" event handler. Until that it is
> done, the event handler won't execute. That is true for any event
> handlers within Studio. Simply having the event handler in the script
> is enough, the event handler has to be hooked up to the object in
> Interface Builder.
>
> Tim Bumgarner
> AppleScript Engineering
>
> On Jan 5, 2004, at 1:40 PM, Matthew Broms wrote:
>
>> Thanks for the reply and link to droplets, Gary. I looked over the
>> whole
>> page and I'm still a bit confused since it appears that this is
>> exactly what
>> I am doing, yet it still doesn't work. Here's my code:
>>
>> on open these_items
>> processUpdates(these_items)
>> end open
>>
>> on processUpdates(theFilePath)
>> display dialog "I'm updating --> theFilePath = " & theFilePath as
>> string
>> end processUpdates
>>
>>
>> Nothing to complex here. What's confusing me isn't necessarily that
>> my code
>> is wrong, but after compiling an applet and having Xcode "reveal in
>> Finder"
>> the applet still doesn't highlight when I drag a text document on top
>> of it
>> (as did my simple little test droplet below). I'm OK trying to debug
>> the
>> thing, but I can't get it to even trigger the event and launch the
>> applet/droplet. I've even put in an 'on idle' handler in an effort to
>> mimic
>> what the assistant sets a project up with (had no effect).
>>
>> Matt
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>>
>>> From: Gary Lists <email@hidden>
>>> Date: Mon, 05 Jan 2004 12:16:21 -0500
>>> To: AppleScript Users <email@hidden>
>>> Subject: Re: Add Droplet functionality to Applet...
>>>
>>> Matthew Broms wrote [01-05-04 10:49 AM]:
>>>
>>>> Can this be done - can an Applet also be a Droplet?
>>>>
>>>> Matt
>>>
>>> Hi Matt. Sure it can. You're on the right track with 'on open', so
>>> it must
>>> be a matter of what you have in that handler. It won't be exactly
>>> the same
>>> as your 'on run' handler (or the main script if you didn't include 'on
>>> run').
>>>
>>> Here is a short page from Apple where the droplet shell is shown.
>>> You can
>>> add your specific code as needed.
>>>
>>> <http://www.apple.com/applescript/guidebook/sbrt/pgs/sbrt.09.htm>
>>>
>>> Best,
>>> --
>>> Gary
>>> _______________________________________________
>>> applescript-users mailing list | email@hidden
>>> Help/Unsubscribe/Archives:
>>> http://www.lists.apple.com/mailman/listinfo/applescript-users
>>> Do not post admin requests to the list. They will be ignored.
>> _______________________________________________
>> applescript-users mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/applescript-users
>> Do not post admin requests to the list. They will be ignored.
> _______________________________________________
> applescript-users mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/applescript-users
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Add Droplet functionality to Applet...
      • From: Tim Bumgarner <email@hidden>
References: 
 >Re: Add Droplet functionality to Applet... (From: Tim Bumgarner <email@hidden>)

  • Prev by Date: Re: Add Droplet functionality to Applet...
  • Next by Date: Re: CPU factor
  • Previous by thread: Re: Add Droplet functionality to Applet...
  • Next by thread: Re: Add Droplet functionality to Applet...
  • Index(es):
    • Date
    • Thread