Opening tiff files

I have a simple app I’ve been using for years that opens files on my MAC (10.15)

Dim f As FolderItem
f= GetFolderItem(sql, FolderItem.PathTypeShell)
f.Open

It opens all file types using the default program except Tiff files (Default program is PREVIEW)

TIFF files now through an error (I know in the past it worked).

I can open the file directly on my MAC with Preview so its not a TIFF/PREVIEW issue.

Is there a new way to open TIFF files?

Thanks
Jim

You may want to verify what is the default to open TIFF, by getting Info for a Tiff file. Perhaps some program changed from Preview to something else.

On Catalina you have to code like GetFolderItem never existed.

1 Like

Thanks for replying

Michel - I checked the default and it is PREVIEW - when I open a TIFF file directly in FINDER it opens with PREVIEW - Just doest work through XOJO “f.open”

Tim - My simple code above worked before - makes sense the upgrade caused an issue

Admit I am a Novice…

Is there a simple change for “GetFolderItem”?

Thanks
Jim

[quote=482496:@Jim McDermott]Is there a simple change for “GetFolderItem”?
[/quote]
Not if you’re having permission issues. Apple no longer allows developers arbitrary access to any file they wish. This is to protect the user. If the file is not located in Application Support or Temporary, you must ask the user for the file with an Open or Save dialog.

A test you can perform to see if this is related is to check if the FolderItem is nil.

dim tf as FolderItem
tf= GetFolderItem(sql, FolderItem.PathTypeShell)

if tf = nil then
  MsgBox("Failed to acquire FolderItem")
  return

end

if tf.Exists = false then
  MsgBox(tf.Name + " does not exist")
  return

end

// Here, we've checked that we got a FolderItem from the API and that it does exist
tf.Open

If either of those error messages displays, it will help track down the source of the problem.

Tim Thanks!
Recieved neither error But did recieve a different error statement…

"An exception of class IOException was not handled. The application must shut down.

Exception Message: The application “statement2003.tif” could not be launched because a miscellaneous error occurred.
Exception Error Number: 256"

Out of curiosity, does this work if you use 2019r1.1 and Catalina? (an older version of Xojo with a different API behind FolderItem)

According to this lookup, that error code isn’t all that helpful :frowning:
https://www.osstatus.com/search/results?platform=all&framework=all&search=256

Hello,
maybe you stumbled about this bug:
feedback://showreport?report_id=59459 and feedback://showreport?report_id=58856
Please try ShowURL(FolderItem.URLPath) instead of FolderItem.Open

Oh that’s helpful!
I’d lean toward #58856 more than #59459 since the latter is labeled Yosemite.
Jim, is a FAT formatted disk involved at all?

Out of curiosity, does this work if you use 2019r1.1 and Catalina? It used to work - when it stopped I’m not sure

MAC HD is APFS

Feedback Case #58856 is not opening up for me

I’m actually more interested in how Xojo builds, rather than OS upgrades. Please try making a build of the exact same code with 2019r1.1 and whatever version you’re using (FolderItem.Open is from API 2.0). Run both on Catalina and compare the results.

#58856 is visible to pre-release testers only it seems. I’ve requested it be made public.
Here’s the title: 58856 - folderitem.launch and folderitem.open can not launch/open files on macOS when files were copied from MSDOS (FAT) formatted disc

The gist of the issue seems to be that if the source of the TIFF was a FAT formatted disk, FolderItem.Launch fails.

Tim

Thanks, Thats it !! All of my TIFF files are pre MAC !!!

If there does not seem to be a solution, do you have any suggestions on an easy procedure to
Query the TIFF filenames (I have the filenames stored in my SQLite Database) and convert them to PDF?

I have 120+ TIFF files in my XOJO App library.

Jim

example …
Open recordset
do until .eof
convert filename.TIFF to filename.PDF
loop
close recordset

The suggestion in the ticket is to use ShowURL as Christian mentioned.

I don’t think converting to PDF is the right path for this one (unless you wanted PDFs in the long run).

Tim - Thanks for helping me with fiquring out what the probelm was and getting to a solution.

Christian - Thanks for your recomended solution. Simple and it worked!

Much thanks!!!

Jim

All my TIF files were created on a Windows PC in the 2005-2007 timeframe

ShowUrl works also for opening word files ! it seem the bug is in the file manager