Hello.
This thread was about storing things as properties in a script, and not being able to saved the script, because of internal table overflow, I just post the script below, as a demonstration, of what is possible after all, so nobody would think that applescript doesn’t allow you to save data within it in the quantities you like. Well, the members of my lists are all numbers, but I can’t conceive that text should be a problem really.
This is just a demonstration of what goes well, you’d need a couple of libraries to run it.
# Earthlib, methods and data from VSOP to calculate the Earth
script Earthlib
property parent : AppleScript
property g_L0EarthCoefficients : {¬
{175347046, 0, 0}, ¬
{3341656, 4.6692568, 6283.07585}, ¬
{34894, 4.6261, 1.25661517E+4}, ¬
{3497, 2.7441, 5753.3849}, ¬
{3418, 2.8289, 3.5231}, ¬
{3136, 3.6277, 7.77137715E+4}, ¬
{2676, 4.4181, 7860.4194}, ¬
{2343, 6.1352, 3930.2097}, ¬
{1324, 0.7425, 1.15067698E+4}, ¬
{1273, 2.0371, 529.691}, ¬
{1199, 1.1096, 1577.3435}, ¬
{990, 5.233, 5884.927}, ¬
{902, 2.045, 26.298}, ¬
{857, 3.508, 398.149}, ¬
{780, 1.179, 5223.694}, ¬
{753, 2.533, 5507.553}, ¬
{505, 4.583, 1.8849228E+4}, ¬
{492, 4.205, 775.523}, ¬
{357, 2.92, 0.067}, ¬
{317, 5.849, 1.1790629E+4}, ¬
{284, 1.899, 796.298}, ¬
{271, 0.315, 1.0977079E+4}, ¬
{243, 0.345, 5486.778}, ¬
{206, 4.806, 2544.314}, ¬
{205, 1.869, 5573.143}, ¬
{202, 2.458, 6069.777}, ¬
{156, 0.833, 213.299}, ¬
{132, 3.411, 2942.463}, ¬
{126, 1.083, 20.775}, ¬
{115, 0.645, 0.98}, ¬
{103, 0.636, 4694.003}, ¬
{102, 0.976, 1.5720839E+4}, ¬
{102, 4.267, 7.114}, ¬
{99, 6.21, 2146.17}, ¬
{98, 0.68, 155.42}, ¬
{86, 5.98, 1.6100069E+5}, ¬
{85, 1.3, 6275.96}, ¬
{85, 3.67, 7.14307E+4}, ¬
{80, 1.81, 1.726015E+4}, ¬
{79, 3.04, 1.203646E+4}, ¬
{75, 1.76, 5088.63}, ¬
{74, 3.5, 3154.69}, ¬
{74, 4.68, 801.82}, ¬
{70, 0.83, 9437.76}, ¬
{62, 3.98, 8827.39}, ¬
{61, 1.82, 7084.9}, ¬
{57, 2.78, 6286.6}, ¬
{56, 4.39, 1.41435E+4}, ¬
{56, 3.47, 6279.55}, ¬
{52, 0.19, 1.213955E+4}, ¬
{52, 1.33, 1748.02}, ¬
{51, 0.28, 5856.48}, ¬
{49, 0.49, 1194.45}, ¬
{41, 5.37, 8429.24}, ¬
{41, 2.4, 1.965105E+4}, ¬
{39, 6.17, 1.044739E+4}, ¬
{37, 6.04, 1.021329E+4}, ¬
{37, 2.57, 1059.38}, ¬
{36, 1.71, 2352.87}, ¬
{36, 1.78, 6812.77}, ¬
{33, 0.59, 1.778985E+4}, ¬
{30, 0.44, 8.399685E+4}, ¬
{30, 2.74, 1349.87}, ¬
{25, 3.16, 4690.48}}
property g_L1EarthCoefficients : {¬
{6.28331966747E+11, 0, 0}, ¬
{206059, 2.678235, 6283.07585}, ¬
{4303, 2.6351, 1.25661517E+4}, ¬
{425, 1.59, 3.523}, ¬
{119, 5.796, 26.298}, ¬
{109, 2.966, 1577.344}, ¬
{93, 2.59, 1.884923E+4}, ¬
{72, 1.14, 529.69}, ¬
{68, 1.87, 398.15}, ¬
{67, 4.41, 5507.55}, ¬
{59, 2.89, 5223.69}, ¬
{56, 2.17, 155.42}, ¬
{45, 0.4, 796.3}, ¬
{36, 0.47, 775.52}, ¬
{29, 2.65, 7.11}, ¬
{21, 5.34, 0.98}, ¬
{19, 1.85, 5486.78}, ¬
{19, 4.97, 213.3}, ¬
{17, 2.99, 6275.96}, ¬
{16, 0.03, 2544.31}, ¬
{16, 1.43, 2146.17}, ¬
{15, 1.21, 1.097708E+4}, ¬
{12, 2.83, 1748.02}, ¬
{12, 3.26, 5088.63}, ¬
{12, 5.27, 1194.45}, ¬
{12, 2.08, 4694.0}, ¬
{11, 0.77, 553.57}, ¬
{10, 1.3, 6286.6}, ¬
{10, 4.24, 1349.87}, ¬
{9, 2.7, 242.73}, ¬
{9, 5.64, 951.72}, ¬
{8, 5.3, 2352.87}, ¬
{6, 2.65, 9437.76}, ¬
{6, 4.67, 4690.48}}
property g_L2EarthCoefficients : {¬
{52919, 0, 0}, ¬
{8720, 1.0721, 6283.0758}, ¬
{309, 0.867, 1.2566152E+4}, ¬
{27, 0.05, 3.52}, ¬
{16, 5.19, 26.3}, ¬
{16, 3.68, 155.42}, ¬
{10, 0.76, 1.884923E+4}, ¬
{9, 2.06, 7.771377E+4}, ¬
{7, 0.83, 775.52}, ¬
{5, 4.66, 1577.34}, ¬
{4, 1.03, 7.11}, ¬
{4, 3.44, 5573.14}, ¬
{3, 5.14, 796.3}, ¬
{3, 6.05, 5507.55}, ¬
{3, 1.19, 242.73}, ¬
{3, 6.12, 529.69}, ¬
{3, 0.31, 398.15}, ¬
{3, 2.28, 553.57}, ¬
{2, 4.38, 5223.69}, ¬
{2, 3.75, 0.98}}
property g_L3EarthCoefficients : {¬
{289, 5.844, 6283.076}, ¬
{35, 0, 0}, ¬
{17, 5.49, 1.256615E+4}, ¬
{3, 5.2, 155.42}, ¬
{1, 4.72, 3.52}, ¬
{1, 5.3, 1.884923E+4}, ¬
{1, 5.97, 242.73}}
property g_L4EarthCoefficients : {¬
{114, 3.142, 0}, ¬
{8, 4.13, 6283.08}, ¬
{1, 3.84, 1.256615E+4}}
property g_L5EarthCoefficients : {1, 3.14, 0}
property g_B0EarthCoefficients : {¬
{280, 3.199, 8.4334662E+4}, ¬
{102, 5.422, 5507.553}, ¬
{80, 3.88, 5223.69}, ¬
{44, 3.7, 2352.87}, ¬
{32, 4.0, 1577.34}}
property g_B1EarthCoefficients : {¬
{9, 3.9, 5507.55}, ¬
{6, 1.73, 5223.69}}
property g_R0EarthCoefficients : {¬
{100013989, 0, 0}, ¬
{1670700, 3.0984635, 6283.07585}, ¬
{13956, 3.05525, 1.25661517E+4}, ¬
{3084, 5.1985, 7.77137715E+4}, ¬
{1628, 1.1739, 5753.3849}, ¬
{1576, 2.8469, 7860.4194}, ¬
{925, 5.453, 1.150677E+4}, ¬
{542, 4.564, 3930.21}, ¬
{472, 3.661, 5884.927}, ¬
{346, 0.964, 5507.553}, ¬
{329, 5.9, 5223.694}, ¬
{307, 0.299, 5573.143}, ¬
{243, 4.273, 1.1790629E+4}, ¬
{212, 5.847, 1577.344}, ¬
{186, 5.022, 1.0977079E+4}, ¬
{175, 3.012, 1.8849228E+4}, ¬
{110, 5.055, 5486.778}, ¬
{98, 0.89, 6069.78}, ¬
{86, 5.69, 1.572084E+4}, ¬
{86, 1.27, 1.6100069E+5}, ¬
{65, 0.27, 1.726015E+4}, ¬
{63, 0.92, 529.69}, ¬
{57, 2.01, 8.399685E+4}, ¬
{56, 5.24, 7.14307E+4}, ¬
{49, 3.25, 2544.31}, ¬
{47, 2.58, 775.52}, ¬
{45, 5.54, 9437.76}, ¬
{43, 6.01, 6275.96}, ¬
{39, 5.36, 4694.0}, ¬
{38, 2.39, 8827.39}, ¬
{37, 0.83, 1.965105E+4}, ¬
{37, 4.9, 1.213955E+4}, ¬
{36, 1.67, 1.203646E+4}, ¬
{35, 1.84, 2942.46}, ¬
{33, 0.24, 7084.9}, ¬
{32, 0.18, 5088.63}, ¬
{32, 1.78, 398.15}, ¬
{28, 1.21, 6286.6}, ¬
{28, 1.9, 6279.55}, ¬
{26, 4.59, 1.044739E+4}}
property g_R1EarthCoefficients : {¬
{103019, 1.10749, 6283.07585}, ¬
{1721, 1.0644, 1.25661517E+4}, ¬
{702, 3.142, 0}, ¬
{32, 1.02, 1.884923E+4}, ¬
{31, 2.84, 5507.55}, ¬
{25, 1.32, 5223.69}, ¬
{18, 1.42, 1577.34}, ¬
{10, 5.91, 1.097708E+4}, ¬
{9, 1.42, 6275.96}, ¬
{9, 0.27, 5486.78}}
property g_R2EarthCoefficients : {¬
{4359, 5.7846, 6283.0758}, ¬
{124, 5.579, 1.2566152E+4}, ¬
{12, 3.14, 0}, ¬
{9, 3.63, 7.771377E+4}, ¬
{6, 1.87, 5573.14}, ¬
{3, 5.47, 1.884923E+4}}
property g_R3EarthCoefficients : {¬
{145, 4.273, 6283.076}, ¬
{7, 3.92, 1.256615E+4}}
property g_R4EarthCoefficients : {4, 2.56, 6283.08}
property g_L1EarthCoefficientsJ2000 : {¬
{6.28307584999E+11, 0, 0}, ¬
{206059, 2.678235, 6283.07585}, ¬
{4303, 2.6351, 1.25661517E+4}, ¬
{425, 1.59, 3.523}, ¬
{119, 5.796, 26.298}, ¬
{109, 2.966, 1577.344}, ¬
{93, 2.59, 1.884923E+4}, ¬
{72, 1.14, 529.69}, ¬
{68, 1.87, 398.15}, ¬
{67, 4.41, 5507.55}, ¬
{59, 2.89, 5223.69}, ¬
{56, 2.17, 155.42}, ¬
{45, 0.4, 796.3}, ¬
{36, 0.47, 775.52}, ¬
{29, 2.65, 7.11}, ¬
{21, 5.43, 0.98}, ¬
{19, 1.85, 5486.78}, ¬
{19, 4.97, 213.3}, ¬
{17, 2.99, 6275.96}, ¬
{16, 0.03, 2544.31}, ¬
{16, 1.43, 2146.17}, ¬
{15, 1.21, 1.097708E+4}, ¬
{12, 2.83, 1748.02}, ¬
{12, 3.26, 5088.63}, ¬
{12, 5.27, 1194.45}, ¬
{12, 2.08, 4694.0}, ¬
{11, 0.77, 553.57}, ¬
{10, 1.3, 6286.6}, ¬
{10, 4.24, 1349.87}, ¬
{9, 2.7, 242.73}, ¬
{9, 5.64, 951.72}, ¬
{8, 5.3, 2352.87}, ¬
{6, 2.65, 9437.76}, ¬
{6, 4.67, 4690.48}}
property g_L2EarthCoefficientsJ2000 : {¬
{8722, 1.0725, 6283.0758}, ¬
{991, 3.1416, 0}, ¬
{295, 0.437, 1.2566152E+4}, ¬
{27, 0.05, 3.52}, ¬
{16, 5.19, 26.3}, ¬
{16, 3.69, 155.42}, ¬
{9, 0.3, 1.884923E+4}, ¬
{9, 2.06, 7.771377E+4}, ¬
{7, 0.83, 775.52}, ¬
{5, 4.66, 1577.34}, ¬
{4, 1.03, 7.11}, ¬
{4, 3.44, 5573.14}, ¬
{3, 5.14, 796.3}, ¬
{3, 6.05, 5507.55}, ¬
{3, 1.19, 242.73}, ¬
{3, 6.12, 529.69}, ¬
{3, 0.3, 398.15}, ¬
{3, 2.28, 553.57}, ¬
{2, 4.38, 5223.69}, ¬
{2, 3.75, 0.98}}
property g_L3EarthCoefficientsJ2000 : {¬
{289, 5.842, 6283.076}, ¬
{21, 6.05, 1.256615E+4}, ¬
{3, 5.2, 155.42}, ¬
{3, 3.14, 0}, ¬
{1, 4.72, 3.52}, ¬
{1, 5.97, 242.73}, ¬
{1, 5.54, 1.884923E+4}}
property g_L4EarthCoefficientsJ2000 : {¬
{8, 4.14, 6283.08}, ¬
{1, 3.28, 1.256615E+4}}
property g_B1EarthCoefficientsJ2000 : {¬
{227778, 3.413766, 6283.07585}, ¬
{3806, 3.3706, 1.25661517E+4}, ¬
{3620, 0, 0}, ¬
{72, 3.33, 1.884923E+4}, ¬
{8, 3.89, 5507.55}, ¬
{8, 1.79, 5223.69}, ¬
{6, 5.2, 2352.87}}
property g_B2EarthCoefficientsJ2000 : {¬
{9721, 5.1519, 6283.07585}, ¬
{233, 3.1416, 0}, ¬
{134, 0.644, 1.2566152E+4}, ¬
{7, 1.07, 1.884923E+4}}
property g_B3EarthCoefficientsJ2000 : {¬
{276, 0.595, 6283.076}, ¬
{17, 3.14, 0}, ¬
{4, 0.12, 1.256615E+4}}
property g_B4EarthCoefficientsJ2000 : {¬
{6, 2.27, 6283.08}, ¬
{1, 0, 0}}
# Not done with all the tests and excersises in chapter 31!
#on run
# set myjde to JDE(2013, 10, 2, 17, 30, 0) of JulianDateLib
# set l to EclipticLongitude(myjde)
# set m to EclipticalLatitude(myjde)
# set R to RadiusVector(myjde)
#end run
on EclipticLongitude(JDE)
local rho, rho2, rho3, rho4, rho5, L0, L1, L2, L3, L4, L5
set rho to (JDE - 2451545) / 36250
set rho2 to rho * rho
set rho3 to rho2 * rho
set rho4 to rho3 * rho
set rho5 to rho4 * rho
# calculate L0
set {L0, L1, L2, L3, L4} to {0, 0, 0, 0, 0}
repeat with i from 1 to (length of g_L0EarthCoefficients)
set L0 to L0 + (item 1 of item i of my g_L0EarthCoefficients) * (cos ((item 2 of item i of my g_L0EarthCoefficients) + (item 3 of item i of my g_L0EarthCoefficients) * rho))
end repeat
# calculate L1
repeat with i from 1 to (length of g_L1EarthCoefficients)
set L1 to L1 + (item 1 of item i of my g_L1EarthCoefficients) * (cos ((item 2 of item i of my g_L1EarthCoefficients) + (item 3 of item i of my g_L1EarthCoefficients) * rho))
end repeat
# calculate L2
repeat with i from 1 to (length of g_L2EarthCoefficients)
set L2 to L2 + (item 1 of item i of my g_L2EarthCoefficients) * (cos ((item 2 of item i of my g_L2EarthCoefficients) + (item 3 of item i of my g_L2EarthCoefficients) * rho))
end repeat
# calculate L3
repeat with i from 1 to (length of g_L3EarthCoefficients)
set L3 to L3 + (item 1 of item i of my g_L3EarthCoefficients) * (cos ((item 2 of item i of my g_L3EarthCoefficients) + (item 3 of item i of my g_L3EarthCoefficients) * rho))
end repeat
# calculate L4
repeat with i from 1 to (length of g_L4EarthCoefficients)
set L4 to L4 + (item 1 of item i of my g_L4EarthCoefficients) * (cos ((item 2 of item i of my g_L4EarthCoefficients) + (item 3 of item i of my g_L4EarthCoefficients) * rho))
end repeat
# Calculate L5
set L5 to (item 1 of my g_L5EarthCoefficients) * (cos ((item 2 of my g_L5EarthCoefficients) + (item 3 of my g_L5EarthCoefficients) * rho))
# convert results back to degrees, and map them within 360
return (mapWithinModulus(((L0 + L1 * rho + L2 * rho2 + L3 * rho3 + L4 * rho4 + L5 * rho5) / 100000000) * 180 / pi, 360) of coordDegLib)
end EclipticLongitude
on EclipticalLatitude(JDE)
local rho, B0, B1
set {rho, B0, B1} to {((JDE - 2451545) / 36250), 0, 0}
repeat with i from 1 to (length of g_B0EarthCoefficients)
set B0 to B0 + (item 1 of item i of my g_B0EarthCoefficients) * (cos ((item 2 of item i of my g_B0EarthCoefficients) + (item 3 of item i of my g_B0EarthCoefficients) * rho))
end repeat
repeat with i from 1 to (length of g_B1EarthCoefficients)
set B1 to B1 + (item 1 of item i of my g_B1EarthCoefficients) * (cos ((item 2 of item i of my g_B1EarthCoefficients) + (item 3 of item i of my g_B1EarthCoefficients) * rho))
end repeat
return (mapWithinModulus(((B0 + B1 * rho) / 100000000) * 180 / pi, 360) of coordDegLib)
end EclipticalLatitude
on RadiusVector(JDE)
local rho, rho2, rho3, rho4, rho5, R0, R1, R2, R3, R4
set {rho, R0, R1, R2, R3} to {((JDE - 2451545) / 36250), 0, 0, 0, 0}
set rho2 to rho * rho
set rho3 to rho2 * rho
set rho4 to rho3 * rho
repeat with i from 1 to (length of g_R0EarthCoefficients)
set R0 to R0 + (item 1 of item i of my g_R0EarthCoefficients) * (cos ((item 2 of item i of my g_R0EarthCoefficients) + (item 3 of item i of my g_R0EarthCoefficients) * rho))
end repeat
repeat with i from 1 to (length of g_R1EarthCoefficients)
set R1 to R1 + (item 1 of item i of my g_R1EarthCoefficients) * (cos ((item 2 of item i of my g_R1EarthCoefficients) + (item 3 of item i of my g_R1EarthCoefficients) * rho))
end repeat
repeat with i from 1 to (length of g_R2EarthCoefficients)
set R2 to R2 + (item 1 of item i of my g_R2EarthCoefficients) * (cos ((item 2 of item i of my g_R2EarthCoefficients) + (item 3 of item i of my g_R2EarthCoefficients) * rho))
end repeat
repeat with i from 1 to (length of g_R3EarthCoefficients)
set R3 to R3 + (item 1 of item i of my g_R3EarthCoefficients) * (cos ((item 2 of item i of my g_R3EarthCoefficients) + (item 3 of item i of my g_R3EarthCoefficients) * rho))
end repeat
set R4 to (item 1 of my g_R4EarthCoefficients) * (cos ((item 2 of my g_R4EarthCoefficients) + (item 3 of my g_R4EarthCoefficients) * rho))
return ((R0 + R1 * rho + R2 * rho2 + R3 * rho3 + R4 * rho4) / 100000000)
end RadiusVector
end script