Using a prompt value from another handler
Using a prompt value from another handler
- Subject: Using a prompt value from another handler
- From: Brett Conlon <email@hidden>
- Date: Wed, 16 Nov 2005 15:50:08 +1000
Hi again,
Hopefully I can find another simple
answer to my (hopefully) simple question. You've been so very helpful with
my previous requests, thanks!!!
Basically the script runs the AskTitle
handler to prompt the user to enter the movie title, then the AskCatNo
handler to prompt for a catalog number. Then the Photoshop Action stuff
is run. Inside the DoAllThis
handler it prompts for the user to choose a client and packshot method
and runs the appropriate PShop Action from the user response.
However I have recently realised that
only the client FHE requires the user to enter a catalog number. SPHE doesn't.
With the script running the way it is now, the user is prompted for a cat
No no matter what client they choose.
I'd like to be able to have the CLIENT
prompt first then the AskCatNo
handler is run only if the user chooses the client FHE.
I can't get my head around the order
to run these things and how I can get the values moving correctly between
handlers.
Here's a condensed version of my code
to help you see where stuff is sitting. If you need any part further elaborated
on, please ask.
--Properties
for the Photoshop dialogs
property
clientNames : {"FHE", "SPHE"}
property
PackshotMethods : {"DVD Slick", "DVD Slick with 1 Disc",
"UMD Slick", "UMD Slick with 1 Disc"}
on
run
set
aFile to
choose file with prompt "Please choose a file to process"
set
replacement_title to
AskTitle(aFile)
set
replacement_catNo to
AskCatNo(replacement_title)
DoAllThis(aFile)
ReplaceTitle(replacement_title)
ReplaceCatNo(replacement_catNo)
end
run
on
open (filelist)
repeat
with
aFile in
filelist
set
replacement_title to
AskTitle(aFile)
set
replacement_catNo to
AskCatNo(replacement_title)
DoAllThis(aFile)
ReplaceTitle(replacement_title)
ReplaceCatNo(replacement_catNo)
end
repeat
end
open
--DO
PHOTOSHOP STUFF
on
DoAllThis(aFile)
--Prompt for Client
name and Packshot type
set
clientName to
item 1 of
(choose from list clientNames with prompt "Choose the Client:")
set
packshotMethod to
item 1 of
(choose from list PackshotMethods with prompt "Choose Packshot type:")
--Then do this
if
clientName is
"FHE" and
packshotMethod is
"DVD Slick" then
display dialog "FHE
DVD Slick Packshots"
--Many
other "else" statements in here
end
if
end
DoAllThis
--ASK
FOR DVD TITLE
on
AskTitle(aFile)
--prompts user
to enter the title of the movie
end
AskTitle
--ASK
FOR DVD CAT#
on
AskCatNo(replacement_title)
--prompts user
to enter a catalog no.
end
AskCatNo
--REPLACE
WORD "Title" with PROMPT RESULT
on
ReplaceTitle(replacement_title)
--removed for brevity
end
ReplaceTitle
--REPLACE
"Cat#" WITH PROMPT RESULT
on
ReplaceCatNo(replacement_catNo)
--removed for brevity
end
ReplaceCatNo
on
set_item_name(this_item, new_item_name)
--removed for brevity
end
set_item_name
Many thanks AGAIN!!!
Regards,
Cojcolds _______________________________________________
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