Not sure I understand the problem. Is it that the files sort differently than you expect, or that as you watch it run, they appear in the folder if different orders sometimes? Maybe give us an example listing showing this “different order”?
Remember that since APFS, the sort order of FolderItems in a directory is not a given. If you want the FolderItems to be sorted alphabetically, you will need to do so after loading them into an array.
I’m an oldster, so, no APFS here (on El Capitan ).
Can it be confirmed that code in a button is executed line after line (I cannot believe it can be otherwise)…
PS: the generated images are very small and so all images appears nearly at the same time in the saved folder. I do not talk about I saw the files created in strange order; they are in the same row, stored in alphabetical order (most of the time.
BTW: in macOS 6/7 time frame (around 1988), we had a trick to alphabetize the order of the files in a folder. s this trick still working on APFS (Intel and M1) volumes ?
macOS X uses its own algorithm to alphabetize listings
they mostly make sense
until they dont
numbers as suffixes on names can mess with that ordering whn you start getting multiple digits added on as its not strictly lexical any more
There was a more detailed explanation either somewhere else here or on Discord…
I had a few hundred files that had Hex values (file$1B etc), and they did not sort in alphabetical order
Nothing promises that files are stored and/or retrieved in any given order, neither alphabetical or even the order in which they were created. It is entirely the “choice” of the OS, and might not even be the same between any two operating systems.
So, once in a while macOS is crazy, then he’s back to normal ?
In the very same subject (resizing images to the same size), years ago I discovered that if I always want to get the same resize (I forgot if that was the width or the height fixed resize) of different sized images, I had to use Doubles instead of Integers (according to the docs, you have to use Integers).
On a different subject: I had hard times years ago with the xojo caches until I cleared them:
at my mrning desk, the project worked fine (sometimes after hard times in debug) to fail after a reboot at home. Then a Clear cache was added into the IDE. Now (on TOF), sometimes people complain about Xojo IDE strange ways; but because they do not read the documentation nor check the preferences, they do not clear the caches. (a phantom - removed - code runs until the developer quit Xojo, then reboot and re-run…)
Conclusion: for me it is still a mystery, but like many others, I will have to live with it.
This is the most often order of appearance of the files. (the order of appearance of the files once created; I do not say they will stay like that after one or many reboots / folder successive closes and opens)
The wong order appears once more. This time I tried some combinations applied on the original file and noticed some … differences:
a. sometimes (odd - even sized) the image is centered differently on screen (vs even - even sized) and the result order is different (how can these be related ? I take the loaded data to resize it, not the displayed canvas).
b. I made many times the resize with the same window, then tried after closing and opening the window. I do not noticed changes.
Obviously, I have to check my resize function, and once done, I have to take time to achieve a real debug session.
Emile… There is no “wrong order”… There is only an order that you don’t want.
If you want the files in a specific order, then YOU have to sort them yourself
The operating system will not guarantee the return order, macOS may differ from Win, FAT may differ from AFPS etc. etc…
File sizes (especially graphics) may not update quickly (especially in Finder). So you might change the file size, and Finder wont say it changed for a while but in fact the actual file size internally is correct.
But if I create folders in one displaying as Icon view with enough rooms to place 5 folders in a row, they always (AFAIK and excepting M1, and post High Sierra) appears in the order of creation.
Of course, I wrote the creation code in Xojo to save the files in a certain order. unlike Windows XP who never displayed my icons at the same place day after day, usually, the files “never” moves by themselves between boots or folder opening (else it is a bug).
Now, nobody knows, I have to move and try to think at fomething else (dinner ?).
I never talk about read files in some order, it is only about saved time.
I drag an image from an open folder (Finder, view by Icon) and in the application front window, I click in a Process PushButton where the files are saved in a certain order. The icons does not always appears - in the open Finder folder - in the same order; mst of the time, not always.
Sorry if I was not crystal clear.
We can ask Finder to sort things, I do not do that in that case.
Finder sort things if the folder is displayed as list, but this is not the case.