• 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
panther weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

panther weirdness


  • Subject: panther weirdness
  • From: Seth Tager <email@hidden>
  • Date: Tue, 11 May 2004 13:33:51 -0700

I recently upgraded to panther and some scripts I ran in the past using java now hang or take an unusually long time (20 min?) to run.

In attempting to debug, I've figured out that the scripts seem to be waiting for (2 * timeout) seconds before returning control to java.

Interestingly enough, the script included below runs fast the very first time I run it after restarting my machine, but after that it always takes 2 minutes to run. (default applescript timeout is 1 minute) If I wrap the script in 'with timeout of 5 seconds ... end' then the script will finish in just over 10 seconds.

The main script I'm trying to run involves Filemaker and I think it hangs completely, but it's possible that it's waiting 2 minutes many, many, times and so I never see it finish. (I've waited over 1/2 hour).

Any idea of what could be the problem? I'm running os 10.3.3

Seth


import com.apple.cocoa.foundation.*;
import com.apple.cocoa.application.NSApplication;
public class testas
{
public static void main(String[] args)
{

String script = "tell application \"Finder\" \n"
+ " get the name of every item "
+ " in the desktop \n"
+ "end tell\n";

NSApplication.sharedApplication();

// This creates a new NSAppleScript object
// to execute the script
NSAppleScript myScript =
new NSAppleScript(script);

// This dictionary holds any errors
// that are encountered during script execution
NSMutableDictionary errors =
new NSMutableDictionary();

// Execute the script!
System.out.println("myScript.executing:");
System.out.println(script);
long start = System.currentTimeMillis();
NSAppleEventDescriptor results =
myScript.execute(errors);
System.out.println("Elapsed time = " + (System.currentTimeMillis()-start)/1000.0 + " seconds");

// Print out everything on your desktop
System.out.println("Starting list of items "
+ "on the desktop: ");

int numberOfDesktopItems = results.numberOfItems();
for(int i = 1; i <= numberOfDesktopItems; i++)
{
NSAppleEventDescriptor subDescriptor =
results.descriptorAtIndex(i);
System.out.println(" " +
subDescriptor.stringValue());
}

}
}
_______________________________________________
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: panther weirdness
      • From: Graff <email@hidden>
    • panther time out bug (was: panther weirdness)
      • From: Seth Tager <email@hidden>
  • Prev by Date: Re: Toggle Modem Autoconnect Preference?
  • Next by Date: Test, critique and ridicule this script!
  • Previous by thread: Choose File anomaly in Panther
  • Next by thread: panther time out bug (was: panther weirdness)
  • Index(es):
    • Date
    • Thread