• 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: "on run" & "on re-run"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "on run" & "on re-run"


  • Subject: Re: "on run" & "on re-run"
  • From: paulskinner <email@hidden>
  • Date: Sat, 16 Feb 2002 01:18:02 -0500

On Friday, February 15, 2002, at 02:45 PM, paulskinner wrote:

Right you are. I responded incorrectly. :^(

Reopen was my first thought, but I changed my response after noting that it was responding to double-clicking by functioning properly. I was thinking that this should pass a reopen event to a running stay-open app.

<ASLG p.152>
Reopen
Reopen is an application command that reactivates a running application. It has the same effect as double-clicking on the applications icon in the Finder when the application is already running.
</ASLG p.152>

So this makes me wonder, is there a REOPEN event or is the RUN event re-routed to the REOPEN handler when the app is already running? Since JJ's app responded to a second icon double click I assume that there are both, but I'd like to know for sure. And of course this begs the question...Does the finder first test the state of the app before generating an event? And if so, why does the icon double-click consistently send RUN?

<ASLG p303>
Run Handlers
All Mac OS applications can respond to the Run command, even if they arent
scriptable. The Finder sends a Run command to an application whenever one of the following actions occurs while that application is not already running:
- The user double-clicks the applications icon.
- The user selects the applications icon and chooses Open from the File menu.
- The applications icon is in the Apple Menu Items folder and the user chooses it from the Apple menu.
- The applications icon is in the Startup Items folder and the user restarts the computer.
If the application is already running when one of these actions occurs, the application is activated but no commands are sent to it.
</ASLG p303>

If this were true then my misguided response would have been correct. Obviously this just isn't accurate. Anyone from Apple want to set it straight? In 10.1.2/1.8.1 the first three actions above result in a reopen event being dispatched even if the application is running.

When I select a running stay-open app in the Dock (OS10.1.2/AS 1.8.1) the app runs it's REOPEN handler; is this correct behavior? I expected an ACTIVATE.

OK I know...'Off to the ASLG with you!' trudge, trudge, trudge...

On Friday, February 15, 2002, at 01:50 PM, Paul Berkowitz wrote:

No, I think he's looking for:

on reopen

end reopen


which will work with a droplet. You can tell it to run (or to open) if you
wish to direct it to do the same as that command handler, or to do something
else instead.

--
Paul Berkowitz

From: paulskinner <email@hidden>
Date: Fri, 15 Feb 2002 13:29:12 -0500
To: AppleScript Users <email@hidden>
Subject: Re: "on run" & "on re-run"

What you're looking for is...

on activate
--do stuff
end

On Friday, February 15, 2002, at 01:19 PM, JJ wrote:

Let's say I'm running a stay-open applet/droplet from apple menu or
from any
app able to launch external files.

on run
beep
end run
--> first time works OK
--> Also, every time it is double-clicked, works OK

But, the second time I choose my app at apple menu, it becomes the
frontmost
app, but doesn't do nothing.

What's the apple event I should handle to catch Finder's requests?
Doesn't it exists "on re-run"?

JJ--
Paul Skinner
_______________________________________________
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.

References: 
 >Re: "on run" & "on re-run" (From: paulskinner <email@hidden>)

  • Prev by Date: Re: Path-Strings to Formatted String
  • Next by Date: Re: loops [naming variables]
  • Previous by thread: Re: "on run" & "on re-run"
  • Next by thread: Re: "on run" & "on re-run"
  • Index(es):
    • Date
    • Thread