I have two different handlers, one which gets the names (which are numbers like "1.0" and "1.1") of folders within a folder, then converts that to an applescript list. Then it passes that list to another handler, which evaluates the list and supposedly identifies the highest number (I got it from http://www.macosxautomation.com/applescript/sbrt/sbrt-03.html ).
on set_values(project_path)
do shell script "ls " & project_path
get words of result
set allvalues to (result)
return allvalues
end set_values
Then I turn result into a variable for the next handler:
set values_list to result
And this is the handler the get the highest number from the list, courtesy of macosxautomation:
on highnum(values_list)
set the high_amount to ""
repeat with i from 1 to the count of the values_list
set this_item to item i of the values_list
set the item_class to the class of this_item
if the item_class is in {integer, real} then
if the high_amount is "" then
set the high_amount to this_item
else if this_item is greater than the high_amount then
set the high_amount to item i of the values_list
end if
else if the item_class is list then
set the high_value to highnum(this_item)
if the the high_value is greater than the high_amount then ¬
set the high_amount to the high_value
end if
end repeat
return high_amount
end highnum
The problem is that the second handler only ever gives off a null response, and i can't figure out why. Any help appreciated.
The point of the application is to simplify the creation of other applications, by allowing the creation of new 'projects', importing existing apps into a new 'project' and to allow editing of a 'project' with ease. In the event that you choose to edit a project, you can choose "minor update" (effectively adding a '0.0.1' to your latest version) or a number of other options i have already finished. The multi-decimal addition i can solve using text item delimiters, but I am not sure how to obtain a multi-decimal number from the highnum() handler, which is the critical part of the process