(* Open an input box to name the file group *)
GroupName = InputString["Enter the file group name:"];
(* Open an input box to name the folder *)
FolderName = InputString["Enter the folder name on the desktop:"];
(* Determine the desktop path *)
DesktopPath = FileNameJoin[{Environment["USERPROFILE"], "Desktop", FolderName}];
(* Create the folder if it doesn't exist *)
If[!DirectoryQ[DesktopPath], CreateDirectory[DesktopPath]];
(* Set the directory as trusted *)
SetDirectory[DesktopPath];
ClearAll
Begin["restrictedContext`"]
Context[dd]
(* Import the variables *)
jet4 = Import["zeros.txt"]; jet = ToExpression[jet4];
jotit = Import["final.txt"];
minus = Import["zerosverdades.txt"];
minus1 = ToExpression[minus];
let2 = jet;
gt = let2 - minus1;
let22 = let2 - gt;
let2 = ToExpression[let22];
jotitvv3 = StringJoin["1.", StringJoin[Table["0", {jet}]], jotit];
vvv = ToString[jotitvv3];
ee3 = ToExpression[vvv]
ii31 = Import["ii3.txt"];
ii3 = ToExpression[ii3];
ii41 = Import["ii4.txt"];
ii4 = ToExpression[ii4];
ii21 = Import["ii2.txt"];
ii2 = ToExpression[ii2];
hh = Import["gh.txt"];
hh2 = ToExpression[hh];
ee3 = dd;
question = {x} /. Solve[(ii2*ii3*x + ii4)/(ii2*ii3*x) == dd, x]
N[%];
send = ii2*ii3*question + ii4;
send2 = Flatten[send];
send3 = Flatten[send2];
answer = DecimalForm[send3];
a = {x1} /. Solve[(ii2*ii3*x1 + ii4)/(ii2*ii3*x1) == dd, x1];
dd = ee3;
letters = (ii2*ii3*a)*dd;
letters1 = ToString[letters];
digits = IntegerDigits[letters, 256];
digits2 = Flatten[digits];
gh = hh2;
hj = Take[%, -1];
bb = Partition[digits2, 4];
bg = Partition[bb, hj];
image = Image[bg, "Byte", ColorSpace -> "RGB", ImageSize -> gh];
img = image
labImg = ColorConvert[img, "LAB"]
(*Exporting ii2, ii3, ii4 with custom names*)
Export[desktoppath <> "/" <> groupname <> "_gh.txt", hh];
Export[desktoppath <> "/" <> groupname <> "_zeros.txt", jet4];
Export[DesktopPath <> "/" <>GroupName <> "_final.txt", jotit];
Export[DesktopPath <> "/" <>GroupName <> "_truezeros.txt", minus];
Export[DesktopPath <> "/" <>GroupName <> "_ii2.txt", ii2];
Export[DesktopPath <> "/" <>GroupName <> "_ii3.txt", ii3];
Export[DesktopPath <> "/" <>GroupName <> "_ii4.txt", ii4];
Save[DesktopPath <> "/fileSaved.mx", {hh, jet4, jotit, minus, ii2, ii3, ii4}];
End[]
(* Restore the previous directory *)
ResetDirectory[];
If I run the decoder above it works perfectly if i do not turn off mathematica after I generate via encoder the files ii and the others needed ... but if i turn it off and import the files that are imported just fine the command solve does not give me the right answer as before... could anyone please resolve this issue ?