• 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: Very slow AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Very slow AppleScript


  • Subject: Re: Very slow AppleScript
  • From: "emile.a.schwarz" <email@hidden>
  • Date: Fri, 01 Mar 2013 13:21:57 +0100 (CET)

Hi,

 

I removed what my code really does because it is not relevant.

 

Also not relevant everything excepted the following line:

 

set ItemToChange to item 1 of SelectedFldr

 

This line takes 7 seconds by its own. When set in a 22 items loop, it grows to 20 seconds to deals with a file (in the complete script).

 

The following line takes a bit more than one second to return the result (but the code is useless):

set ItemToChange to item 1 of front window

 

What the complete script do is scan the front window (or a folder the user choose), in a repeat statement, reads the first 10 bytes of each file, compare what he got to a large list of nested if elseif .../... end if block and if something is found, set the file name extension from what is wrongly set (cbr, cbz, cb7, whatever) to rar, zip or 7z. (I omitted many other entries.

 

Originally, I was thinking the faultive (was me) was in that very long if block. I commented it out and saw that I was wrong: the slow line is the one I gave earlier in this mail.

 

Now you know (more or less) what the OP is doing (or try to do), but this is not relevantr to the question unless a better way exists to do that.

 

Is it crystal clear now ?

 

An idea someone ?

 

Emile

 

PS: running the shared code from the original post would let you see the time done to just get a reference to an item from a Finder folder.

I was thinking that I was correctly displaying my problem, but I was wrong. ;-:)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Very slow AppleScript
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Very slow AppleScript
  • Next by Date: Re: Very slow AppleScript
  • Previous by thread: Re: Very slow AppleScript
  • Next by thread: Re: Very slow AppleScript
  • Index(es):
    • Date
    • Thread