• 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: Creating a script from within a script and running it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a script from within a script and running it


  • Subject: Re: Creating a script from within a script and running it
  • From: Axel Luttgens <email@hidden>
  • Date: Tue, 08 Oct 2013 19:56:34 +0200

Le 8 oct. 2013 à 17:20, Jim Brandt a écrit :

> [...]
>
> So, my question is, is it possible to build a dynamic script such as this
> and get it to return a result (in this case a list)?

Hello Jim,

The result is the one returned from the run handler; and, strictly speaking, that handler expects a list as argument.

Here follows a slightly modified version of your script, mainly in an attempt to make the script construction a bit more legible:

set PR to {dd:"2013-10-08", div5:"0", div2:"0", Client:"My Client", div3:"1", div4:"0", div1:"1", cb:"0"}
set Divisions to {"Division1", "Division2", "Division3", "Division4", "Division5"}

set CountChecked to "
on run L
	set P to item 1 of L
	set Divs to item 2 of L
	set DC to {}"
repeat with i from 1 to count of Divisions
	set CountChecked to CountChecked & "
	if div" & i & " of P = \"1\" then set end of DC to item " & i & " of Divs"
end repeat
set CountChecked to CountChecked & "
	return DC
end run"

set DivisionChoices to run script CountChecked with parameters {PR, Divisions}

HTH,
Axel


 _______________________________________________
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: Creating a script from within a script and running it
      • From: Luther Fuller <email@hidden>
References: 
 >Creating a script from within a script and running it (From: Jim Brandt <email@hidden>)

  • Prev by Date: Creating a script from within a script and running it
  • Next by Date: plist data type 'data'
  • Previous by thread: Creating a script from within a script and running it
  • Next by thread: Re: Creating a script from within a script and running it
  • Index(es):
    • Date
    • Thread