Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Copy export multiple image file to clipboard? #27

Open
atticus-lv opened this issue Jan 9, 2022 · 3 comments
Open

FEATURE: Copy export multiple image file to clipboard? #27

atticus-lv opened this issue Jan 9, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@atticus-lv
Copy link
Contributor

atticus-lv commented Jan 9, 2022

Problem

I am working on export multiple files to clipboard. So that I can paste them to finder easily
But I am not very familiar with mac, so I only create a simple script to export only one file

class MacClipboard():
    def __init__(self, file_urls=None):
        # file_urls: list[str] = None
        self.file_urls = file_urls
    def push_to_clipboard(self, paths):
        commands = [
            "set the clipboard to "
            f'(POSIX file "{paths[0]}")'
        ]
        subprocess.Popen(self.get_osascript_args(commands))

    def get_osascript_args(self, commands):
        args = ["osascript"]
        for command in commands:
            args += ["-e", command]
        return args

Idea

Now I want to copy multiple files to clipboard on mac, but I don't know how to let it to be run in subprocess.
I found some script like this

Images

No response

Additional context

No response

@atticus-lv atticus-lv added the enhancement New feature or request label Jan 9, 2022
@thanhph111
Copy link
Collaborator

Bad news, I'm not familiar with macOS too, neither AppleScript 🤣. But with non-Blender procedures like this, I can use a virtual machine to test.

As I understand, you are trying to stack multiple images to the clipboard so we can paste them to other apps (like Finder). That's great, but what editor would you like to implement the operator for?

I also want to replace totally the current pasteboard binary by AppleScript, but I still don't have a chance to work with macOS. If you want to implement this feature, I would love to help.

The terminology push and pull may confuse you at first, I think the comment here and here would help.

You also might find useful information about macOS implementation history in this and this PR.

@atticus-lv
Copy link
Contributor Author

FIne, I don't have a chance to work with macOS, too. I just make an extra part base on this addon for my friend who work on mac(I finish the win part actually, it is much easier for me to test). However, testing mac (remote working on his computer) is really hard.

@thanhph111
Copy link
Collaborator

@williamchange Sorry to ping you on any macOS and Apple related posts but I'd really like to hear your opinion on this. Do you think the macOS clipboard can hold multiple images at once with AppleScript?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants