• 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
Calling a handler from inside a handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Calling a handler from inside a handler


  • Subject: Calling a handler from inside a handler
  • From: Brett Conlon <email@hidden>
  • Date: Mon, 14 Nov 2005 16:50:25 +1000


Hi all,

Simply:

Can I call a handler from within a handler, ie. a handler that is telling Photoshop to do something with a file and after doing that (still within the handler) it runs another handler that asks the Finder to create a folder alias?

To explain:

I have a handler, DoAllThis(aFile), telling Photoshop to run a specific Action, depending on what the user chooses from prompts (1. Client and 2. movie packshot method).

From within this handler I added a tell application "Finder" statement that creates folder aliases on the desktop to the relevant server folders, again depending on what the user chose. This all worked quite nicely but as I was adding more and more Photoshop Action options I found I was using the same Finder tell statements to create the same aliases over and over again.

Hoping to simplify my script I wanted to add a handler for each folder alias that needed to be created, then call the handler after Photoshop had finished doing its thaing.

But I think Photoshop didn't know how to execute the handler.

Here's a simplified example of what I wanted to do:

#######################################
on DoAllThis(aFile)
        tell application "Adobe Photoshop CS"
                activate
                tell current document
                        activate
                        if clientName is "FHE" and packshotMethod is "DVD Slick" then
                                do action "RUN ALL" from "FHE DVD Slick Packshots.atn"
                                AliasFoxRetailDVD3D()
                                AliasFoxRetailDVDFLAT()
                                AliasFoxRentalDVD3D()
                                AliasFoxRentalDVDFLAT()
                        else if clientName is.......
and so on....

on AliasFoxRentalDVD3D()
        tell application "Finder"
                try
                        make new alias at folder "PACKSHOTS" to folder FoxRentalDVD3D with properties {name:"To Fox Rental DVD 3D"}
                end try
        end tell
end AliasFoxRentalDVD3D

and so on......
#######################################

It worked when I had it like this (but just seemed cumbersome):
#######################################
if clientName is "FHE" and packshotMethod is "UMD Slick" then
        do action "RUN ALL" from "FHE UMD Slick Packshots.atn"
                tell application "Finder"
                        try
                                make new alias at folder "PACKSHOTS" to folder FoxRetailUMD3D with properties {name:"To FHE UMD Retail 3D"}
                        end try
                end tell
#######################################

Am I expecting too much???

Ta muchly,

Brett
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Calling a handler from inside a handler
      • From: email@hidden
  • Prev by Date: Re: do shell script "sort" not working : Thanks!
  • Next by Date: Adobe InDesign placing text or picture box on a layer?
  • Previous by thread: Re: Get default icon of document/application/folder programmatically
  • Next by thread: Re: Calling a handler from inside a handler
  • Index(es):
    • Date
    • Thread