Hi Hugh,
yes, you are right, the use of Dynamic
causes here the problem:
selectedTiles // FullForm
(* Out: Dynamic[Complement[Flatten[imgMat0],Flatten[imgMat]]] *)
so either you invoke single tiles writing:
First[selectedTiles][[i]]
or you just omit Dynamic
and write:
selectedTiles = Complement[Flatten@imgMat0, Flatten@imgMat]
then it should work. Note that there are typos in you code, it should read:
file = FileNameJoin[{"/Users", "me", "Desktop", "Mathematica", "myfolder"}];
Table[Export[FileNameJoin[{file, StringJoin["myfile[", ToString[i], "].jpg"]}],
selectedTiles[[i]], "JPEG"], {i, Length[selectedTiles]}]
As a remark (my personal "taste"): Instead of using Table
here I would use MapIndexed
, like so:
MapIndexed[Export[FileNameJoin[{file, StringJoin["myfile[", ToString[First[#2]], "].jpg"]}], #1, "JPEG"] &, selectedTiles]
Regards -- Henrik