Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 18, 2012, 04:53 PM   #1
1theo0
macrumors member
 
Join Date: Jul 2012
Running multiple actions on multiple items selection

Hello! Can I make a script say "A" then "B" (ActionA and ActionB) if the user selects both options in the list? I can't install AppleScript Studio right now, and wanted to know if it is possible to do this with AppleScript Editor...
Thanks!
Quote:
set Options to {"A", "B", "C"}
on ActionA()
say "A"
end ActionA

on ActionB()
say "B"
end ActionB

on ActionC()
say "C"
end ActionC

set ListA to (choose from list Options with prompt "Choose items to be spoken. Hold command (⌘) to select multiple letters" with title "Chocolate" with multiple selections allowed) as text

if ListA is "A" then
ActionA()
end if

if ListA is "B" then
ActionB()
end if

if ListA is "C" then
ActionC()
end if
__________________
MacBook White 4,1 2010 model
1theo0 is offline   0 Reply With Quote
Old Dec 21, 2012, 07:44 AM   #2
Supermacguy
macrumors regular
 
Join Date: Jan 2008
What you want to do is repeat with each object in the selection list. So your chosen things from the list is something like {"A", "B"}.

set chosenList to (choose from list Options with prompt "Choose items to be spoken. Hold command (⌘) to select multiple letters" with title "Chocolate" with multiple selections allowed) as text
-->result is {"A", "B"}

repeat with anItem in chosenList
if anitem is "A" then
ActionA()
end if

if anItem is "B" then
ActionB()
end if

if anItem is "C" then
ActionC()
end if
end repeat
Supermacguy is offline   1 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Finder Move/Copy/Paste Multiple Items Status Combined or Individual rick3000 OS X 1 Jul 17, 2013 02:41 AM
How to delete MULTIPLE reading list items at the same time patent10021 OS X 0 Apr 9, 2013 01:13 AM
Another multiple ID, multiple device, multiple phone number iMessage question mrcalabash iOS 6 3 Jan 12, 2013 07:45 PM
Not all items being tagged when tagging multiple items in iTunes willryan42 Mac Applications and Mac App Store 0 Oct 8, 2012 06:44 PM

Forum Jump

All times are GMT -5. The time now is 11:46 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC