Applescript to make an applescript?

Is this possible?

I want to make an applescript to ask a series of questions then apply the answers to an exisiting applescript. So that the main file can be updated,

The questions would be the 12 different options on one line.


Thanks


Matt


The file to update looks like this

property brandTable : {¬

	{brandID:{"AP88"}, brandGroup:{"Apricot", 1500, 1500, true, false, "FFFFFF", true, true, true, false, true}}, ¬

	{brandID:{"BA44"}, brandGroup:{"Banana", 1020, 1530, false, false, "F4F4F4", false, true, true, false, true}}, ¬

	{brandID:{"CA22", "CC24"}, brandGroup:{"Cauliflower", 1196, 1300, true, false, "FFFFFF", true, true, true, false, true}} ¬

		}

Posted on Feb 7, 2019 6:22 AM

Reply
19 replies

Feb 14, 2019 1:34 AM in response to MattJayC

----------------------------------------------------------------------------------------------------------------


----------------------------------------------------------------------------------------------------------------


on get_brandGroup(brandTable, brandName, brandID)


(*


        list brandTable : list of records


        string brandName : brand name


        string brandID : brand id


        return list : brandGroup corresponding to given brandName or brandID in brandTable


        * brandGroup = {brandName, width, height}


    *)


set brandGroup to missing value


repeat with b in brandTable


set b to b's contents


if brandName is in b's brandGroup or brandID is in b's brandID then


set brandGroup to b's brandGroup


exit repeat


end if


end repeat


return brandGroup


end get_brandGroup


----------------------------------------------------------------------------------------------------------------




on get_brandNames(brandTable)


(*


        list brandTable : list of records


        return list : list of every brandName (brandGroup's item 1) in brandTable


        * brandGroup = {brandName, width, height}


    *)


set brandNames to {}


repeat with b in brandTable


set brandNames's end to b's brandGroup's item 1


end repeat


return brandNames


end get_brandNames




on roundThis(n, numDecimals)


set x to 10 ^ numDecimals


tell n * x to return (it div 0.5 - it div 1) / x


end roundThis

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript to make an applescript?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.