The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   OS X Developer (http://hintsforums.macworld.com/forumdisplay.php?f=27)
-   -   AppleScript: I want to quit the script editor. (http://hintsforums.macworld.com/showthread.php?t=30478)

yellow 11-10-2004 04:46 PM

If I go further, all I get are:

arg11: -psn_0_550502411
arg12: -psn_0_550502412
arg13: -psn_0_550502413
arg14: -psn_0_550502414
arg15: -psn_0_550502415
arg16: -psn_0_550502416
arg17: -psn_0_550502417
arg18: -psn_0_550502418

<sigh>

Thanks for all the help!

hayne 11-10-2004 05:31 PM

I did some googling and found a macosxhints article (which yellow has evidently seen since he added a comment to it today) and two Lotus Notes forum discussions:
http://www.macosxhints.com/article.p...30627172202953

http://www-10.lotus.com/ldd/nd6forum...5?OpenDocument

http://www-10.lotus.com/ldd/nd6forum...0?OpenDocument

The macosxhints article suggests a strange workaround - selecting a blank document file (instead of an application). Did you try this yellow?
There is also a comment by someone who supplied a URL (no longer valid) for an AppleScript to make this work.

The first of the Lotus forums links has an AppleScript from Lotus Support that people have apparently had success with.
The second of the Lotus forums links has a submission by the same person who wrote the script mentioned in the comment to the macosxhints article.

Yellow:
I would go back to trying the straight AppleScript solution (save as Application) and contact Lotus support if it doesn't work.

I don't understand why you would get all those "psn_xxx" arguments in the command line of the application invoked by Notes. Usually there is one such argument that I think indicates the process number for backward compatibility with Process Manager software (used in Classic).

yellow 11-10-2004 09:45 PM

I wonder if part of this problem is the fact that Notes is a carbonized app..

yellow 11-10-2004 09:51 PM

Currently I'm using the AppleScript method, but I cannot save it as an app. I found out why. For whatever reason, when the app is invoked, it runs random applescripts. If I remove every other apple script from the Mac, the app runs great. I noted this a little further up in this thread.

http://forums.macosxhints.com/showpo...6&postcount=13

It's still not clear to me if this is a problem with Notes, or that Applescript is screwy. Someone mentioned something about prebinding, but that seems far-fetched to me. I talked with some other Mac heads who use Notes and they were all seeing the same thing.

But for the moment, Applescript works, provided my users don't mind the script editor running.

Thanks for the continued help!

hayne 11-11-2004 01:30 AM

Quote:

Originally Posted by yellow
Currently I'm using the AppleScript method, but I cannot save it as an app. I found out why. For whatever reason, when the app is invoked, it runs random applescripts.

That is very weird.
But recalling what was said in that macosxhints article - that you could point Notes to a document file and it would work to run the application associated with that document - I'm thinking that what Notes might be doing is searching for an app with a specified creator code and then running that app.
If this is the case, you might be able to solve your problem by saving your script as an application but then using one of the many 3rd-party utilities that can edit creator codes and change the creator code to something unique. You would do this before you point Notes to this app. That way (if my theory is right) it would be sure to run the correct AppleScript since only yours would have the creator code it was looking for.

Quote:

But for the moment, Applescript works, provided my users don't mind the script editor running
So, the situation seems to be that the script will work if it runs from within the Script Editor, but not stand-alone.
This is similar to that described in this macosxhints article:
http://www.macosxhints.com/article.p...00401270713117
where people seemed to identify the problem as related to the format used by Script Editor for compiled apps.
They recommended removing the resource fork of the .app file

bunnz 11-11-2004 10:21 AM

yellow:

Quoting hayne -

"I'm thinking that what Notes might be doing is searching for an app with a specified creator code and then running that app.
If this is the case, you might be able to solve your problem by saving your script as an application but then using one of the many 3rd-party utilities that can edit creator codes and change the creator code to something unique. You would do this before you point Notes to this app. That way (if my theory is right) it would be sure to run the correct AppleScript since only yours would have the creator code it was looking for."

Given the behavior yellow describes, hayne is likely on the right track to solving the problem for an AS application.

Change the creator type (as he suggests) to a unique four character signature. If the app has a resource fork, open the app with a resource editor and set the BNDL signature to the same as the creator. Open the plst resource and scroll most of the way down til you find 'aplt' in the XML code. Replace 'aplt' with your unique signature. Save changes and point notes to the script app. Whut hoppen?

For a script app with no resource fork, I think you change the .plist in the same manner as for the plst resource above... but I don't have much experience with app bundles.

I _think_ Notes should be able to 'see' the recreatored app.

Let us know if this works.

Peter B.

-----

hayne 11-11-2004 10:38 AM

Quote:

Originally Posted by bunnz
If the app has a resource fork, open the app with a resource editor and set the BNDL signature to the same as the creator. Open the plst resource and scroll most of the way down til you find 'aplt' in the XML code. Replace 'aplt' with your unique signature.

You can do this much more easily by using one of the specialized utilities for editing type & creator code - e.g. XRay (http://www.brockerhoff.net/xray/)


All times are GMT -5. The time now is 05:37 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.