Get error for NSWorkspaceMBS.performFileOperation

  1. 10 months ago

    Beatrix W

    6 Feb 2019 Pre-Release Testers, Third Party Store Europe (Germany)

    How do I get information why

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

    fails?

  2. Sascha S

    6 Feb 2019 Pre-Release Testers, Xojo Pro Germany, Lower Saxony

    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

    6 Feb 2019 Pre-Release Testers, Third Party Store Europe (Germany)

    I got 3 reports from customers today about this issue.

  4. Christian S

    6 Feb 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    What value does Tag have in that case?

    Maybe it runs asynchronously.

  5. Beatrix W

    6 Feb 2019 Pre-Release Testers, Third Party Store 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

    6 Feb 2019 Pre-Release Testers, Third Party Store Europe (Germany)

    One user had his archive in a Boxcryptor folder.

  7. Sam R

    10 Feb 2019 Pre-Release Testers, Xojo Pro, Third Party Store Hengchun, Pingtung, Taiwan
    Edited 10 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!