Skip to content

Some services fail on files #1805

@skurfer

Description

@skurfer

As reported on the list. To reproduce:

  1. Enable Terminal’s “New Terminal at Folder” service
  2. Select a folder in Quicksilver
  3. Select the service in the second pane and run it

By changing things around, I accidentally got the OS to give me a useful error message. Terminal expects public.file-url, even though that isn’t specified in its property list anywhere.

% /usr/libexec/PlistBuddy /Applications/Utilities/Terminal.app/Contents/Info.plist -c Print:NSServices:0           
Dict {
    NSMenuItem = Dict {
        default = New Terminal at Folder
    }
    NSRequiredContext = Dict {
        NSTextContent = FilePath
    }
    NSSendTypes = Array {
        public.plain-text
    }
    NSPortName = Terminal
    NSSendFileTypes = Array {
        public.directory
        com.apple.resolvable
    }
    NSMessage = newTerminalAtFolder
}

This is probably similar to what #1740 was originally created to fix. I was able to get that service working by making three changes:

  1. File objects need [obj setObject:fileURL forType:@"public.file-url"] sometime before the service runs, where fileURL is a string not an NSURL.
  2. The Services plug-in needs to add public.file-url to sendTypes before putting the object on the pasteboard.
  3. When putting it on the pasteboard, Quicksilver needs to be taught not to convert the URL string to a property list.

I haven’t attempted any changes because for all I know, this only explains the failure of one service and others are expecting yet another type. Also, I could have sworn I smelled pasta cooking. @pjrobertson is much more familiar with this stuff, both from the app side and the plug-in side. There might be a simpler fix. 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions