My Application’s Service Files window

I created a window to deal with my application’s Service Files.

I have a design question about a function I add into a current project (not meant to ends at the App Store, nor elsewhere).

I provided a screen shot (OS X) to let you know what I mean.

The project have a folder in the ApplicationData that holds three text files holding service data.

One thing I strongly dislike is to get service data from application(s) I used once or twice or… and I trashed long ago. That is why I add a MenuItem to delete them (since… ages).

But I only can delete files I know of. As an example, there can be crash files plists in OS X. Who knows how many other files OS X can creates and where. Also, I do not really know what Windows does (nor what Linux do).

Now the questions:

a. Must I try to delete these files (knowing that I may not have the real list) ?

b. In the clear folder button, I delete all items that can be found in that folder, then I delete the folder itself. I do that per Xojo standards AND because of the invisible files (mostly under Windows) that can be there (for unknown reason(s).

PS: I use this project as a proof of concept for this feature. Just like everybody, once a feature is OK, I may use it in all my projects (when relevant).

BTW: the Show xyz buttons code’s writing was… astonishing. Just like the previous time I add this (Reveal the Item) feature, the Language Reference was… disturbing at most as the use of the Launch word… I do what I do the previous time: I go to the project I use this feature to know how I coded it. The correct way is to use

f.Parent.Launch

if the object to display is not a folder or the item will be launched by an application. Paul (someone) ? Can you add an explanation that display this alternate way to use FolderItem.Launch ?
If I have troubles ding that AND I know that I can do it - probably using FolderItem.Launch - who knows how many peopleshare the same situation without knowing it is possible to achieve that with simple Xojo code ?

How many people still use an AppleEvent (or an Apple Script) to do that and ask themselves how to do it X-Platform ?

No, you don’t have to. OS X is okay with your app leaving settings files behind. If your user is not, there are quite a number of apps on the market that find orphaned settings, caches, and logs for the user to delete.
AppZapper and AppCleaner to name two.

The very first line of the FolderItem.Launch documentation states that. While it doesn’t mention how to open a folder, it tells you what happens when you launch a document.

I have not yet had a need for this function and I knew that launching on a folder opens it in Finder. It’s common knowledge around the forums, and with a little ingenuity someone could figure it out them self if they had to.

AppleScript or a declare is the only way to launch the folder and select the item in Finder. With just a couple minutes of searching I found this thread that shows how to show and select an item cross platform.

Thanks for your answer Tim.

About the applications that delete orphaned settings files: if every application clean its own file(s) before been trashed, the need for these applications will be near to zero ?

OK: a perfect world does not exists…

So, I will stay as I am right now.

BTW: for the documentation, i maintain my comment because there are three cases *:

a. If the FolderItem is an application, the application is launched.

b. If the FolderItem is a document, the document is opened and the application is launched if necessary.

c. If the FolderItem is a Folder (Directory), it is simply opened in the Finder (Explorer). **

a and b comes from the documentation, I added (here) the third point.

Now, a fourth point may be added: the one from the AppleScript (read the thread link you provide above).

  • And any other opinion is valid.

** Then the user may find the searched file. (it will took more or less time depending on the number of files in the target folder/directory).

Yeah !

Since I can show my Application folder in the ApplicationData folder, I was able to copy in the Windows 81. Laptop the data files I used in the OS X laptop !

A simple click in one of the Show XXX buttons and I copied the files in the Explorer !

I do not thank at that when I coded that “feature”.

Nice