Get error for NSWorkspaceMBS.performFileOperation

  1. 4 months ago

    Beatrix W

    Feb 6 Pre-Release Testers Europe (Germany)

    How do I get information why

    NSWorkspaceMBS.performFileOperation(NSWorkspaceMBS.NSWorkspaceRecycleOperation, source, dest, files, tag)

    fails?

  2. Sascha S

    Feb 6 Pre-Release Testers, Xojo Pro Germany

    Christian advised me today to start my App via the Terminal to maybe see issues i can't catch otherwise. Maybe this could help here too?

  3. Beatrix W

    Feb 6 Pre-Release Testers Europe (Germany)

    I got 3 reports from customers today about this issue.

  4. Christian S

    Feb 6 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    What value does Tag have in that case?

    Maybe it runs asynchronously.

  5. Beatrix W

    Feb 6 Pre-Release Testers Europe (Germany)

    I think that the code is mostly out of an example:

    if fileToDelete = Nil or not fileToDelete.Exists then Return False
    dim tag as Integer
    dim source,dest as FolderItem
    source = fileToDelete.Parent
    dim files(-1) as string
    files.Append fileToDelete.name
    dim b as Boolean = NSWorkspaceMBS.performFileOperation(NSWorkspaceMBS.NSWorkspaceRecycleOperation, source, dest, files, tag)
    if not b then Globals.theErrorLog.LogItem "It wasn't possible to delete the file " + fileToDelete.NativePath
    Return b
  6. Beatrix W

    Feb 6 Pre-Release Testers Europe (Germany)

    One user had his archive in a Boxcryptor folder.

  7. 3 months ago

    Sam R

    Feb 10 Pre-Release Testers, Xojo Pro Hengchun, Pingtung, Taiwan
    Edited 3 months ago

    I am sorry to report, that it's deprecated (Since 10.11 El Cap) and therefore cannot be trusted to work.

    https://developer.apple.com/documentation/appkit/nsworkspace/1524886-performfileoperation?language=objc

    You should seek an alternative function.

or Sign Up to reply!