• 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: Question about handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about handler


  • Subject: Re: Question about handler
  • From: Graff <email@hidden>
  • Date: Fri, 02 Apr 2004 10:05:44 -0500

You can set pictureCount as a global variable. Do this at the top of the script:

global pictureCount

The values of global variables are saved between runs so it is a good idea to initialize them to clear any retained values that might mess up your calculations. You are doing this in the open handler already so this shouldn't be a problem.

- Ken

On Apr 2, 2004, at 9:44 AM, stephan wrote:

Hello all,

Is there a way to pass the info for a variable from one handler to an other
one. I need to be able to count the number of file beeing process.

Example:


on open objectList

set pictureCount to 0

repeat with objectRef in objectList
set pictureFileRef to objectRef
processAFile (pictureFileRef)
end repeat

finalizeProcess ()
end open objectList



on processAFile (pictureFileRef)

copy file pictureFileRef to folder x
set pictureCount to pictureCount + 1

end processAFile



on finalizeProcess ()

display dialog "Number of images copied is:" pictureCount

end finalizePorcess

Thanks!

--

Stephan Adam

Stephan Adam Consultant inc.
Solutions d'automatisation
www.saconsultant.com

email@hidden
Cell. : (514) 944-6139

Membre associi, Filemaker Solutions Alliance
Associate Member, Filemaker Solutions Alliance
_______________________________________________
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: Question about handler
      • From: Robert Poland <email@hidden>
References: 
 >Question about handler (From: stephan <email@hidden>)

  • Prev by Date: Saving Entourage Attachment solution
  • Next by Date: Re: Get System Info - How
  • Previous by thread: Question about handler
  • Next by thread: Re: Question about handler
  • Index(es):
    • Date
    • Thread