set ListOfVariables to {}
set VariableBlock to paragraphs of (read file "Macintosh HD:Users:whomever:Desktop:Test.txt")
repeat with nextLine in VariableBlock
if length of nextLine is greater than 0 then
copy nextLine to the end of ListOfVariables
end if
end repeat
set textFile to "/Users/whomever/Desktop/BATTERY.txt"
set PropertyVariables to "property eGrepœ1 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{2},ΩΩd{3}.ΩΩd{2}µ
property eGrepœ2 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{2},ΩΩd{3}.ΩΩd{2}µ
property eGrepœ3 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{1},ΩΩd{3}.ΩΩd{2}µ
property eGrepœ4 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{3}.ΩΩd{2}µ
property eGrepœ5 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{2}.ΩΩd{2}µ
property eGrepœ6 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{1}.ΩΩd{2}µ
property eGrepœ7 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{1}.ΩΩd{1}µ
property eGrepœ8 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{1}.ΩΩd{3}µ
property eGrepœ9 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{1}.ΩΩd{4}µ
property eGrepœ10 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{1}.ΩΩd{5}µ
property eGrepœ11 : µpriceValue___11gHJΩµ>ΩΩ$ΩΩd{1}.ΩΩd{6}µ
"
set BlankPropertyVariables to "property current®Price : missing value
"
repeat with theItem in ListOfVariables
set findText1 to "œ"
set replaceText1 to theItem
set newText1 to do shell script "sed 's|" & quoted form of findText1 & ¬
"|" & quoted form of replaceText1 & "|g' <<< " & quoted form of PropertyVariables
do shell script "echo " & quoted form of newText1 & " >> " & quoted form of textFile
end repeat
repeat with theItem in ListOfVariables
set findText2 to "®"
set replaceText2 to theItem
set newText2 to do shell script "sed 's|" & quoted form of findText2 & ¬
"|" & quoted form of replaceText2 & "|g' <<< " & quoted form of BlankPropertyVariables
do shell script "echo " & quoted form of newText2 & " >> " & quoted form of textFile
end repeat
set IdleLoop1 to "on idle
getPrices()
set {year:y, month:m, day:d} to (current date)
tell application µMicrosoft Excelµ
open µ/Users/clusterflux/Desktop/人MASTER人_excel.xlsxµ
set display alerts to false
first row index of (get end (last cell of column 2) direction toward the top)
set LastRowCrypto to first row index of (get end (last cell of column 2) direction toward the top)
set value of cell (µBµ & LastRowCrypto + 1) to y
set value of cell (µCµ & LastRowCrypto + 1) to (µ=TODAY()µ)
set value of cell (µDµ & LastRowCrypto + 1) to d
set value of cell (µEµ & LastRowCrypto + 1) to (time string of (current date))"
do shell script "echo " & quoted form of IdleLoop1 & " >> " & quoted form of textFile
This is part of the way on what I'm talking about. It doesn't currently work on my machine but it should work by writing a large text file saved to the desktop. The generated text file will still need to be modified slightly because of syntax but it's a simple find/replace all for the placeholders. It took a lot of brain squishing but it saved me copy and pasting it like an idiot.