I want to develop a script like reading INI concept. Below is the format of TEXT file.
I want to take all values in a variable, like I want 10 in a var_Resolution, BLACK in var_Color etc. How can i do it, pleas suggest me.
Below the code upto what I have done.
tell application "Finder"
set myFile to (choose file with prompt "Select INI file" of type {"TEXT"})
open for access myFile
set myFileContents to read myFile
set TOT to get count of lines
close access myFile
end tell
set myFile to (choose file with prompt "Select INI file" of type {"public.plain-text"})
set myFileContents to paragraphs of (read myFile)
-- set TOT to get count of lines
set a to {}
set {TID, text item delimiters} to {text item delimiters, "="}
repeat with i in myFileContents
set end of a to word 1 of text item 2 of i
end repeat
set text item delimiters to TID
set {var_Resolution, var_Color, var_Type} to a