• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

photoshop how to load and execute the plugin on mac?

Community Beginner ,
Jul 06, 2023 Jul 06, 2023

Copy link to clipboard

Copied

my code like this, to load plugin and run function in bundle.

 

   if (g_bundlePath == nullptr) {
        g_bundlePath = CFSTR("/Applications/test.plugin");


        CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, g_bundlePath, kCFURLPOSIXPathStyle, true);
        g_bundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);

        if (g_bundle) {
            bool success = CFBundleLoadExecutable(g_bundle);
        }

    }

    if (g_bundlePath != nullptr) {
        typedef void (*PLUGINPROC)(const int16, void*, intptr_t*, int16*);
        PLUGINPROC mainProc = (PLUGINPROC)CFBundleGetFunctionPointerForName((CFBundleRef)g_bundle, CFSTR("PluginMain"));
        mainProc(selector, filterRecord, data, result);
    }
    return ;

 

but those icons in resource directory cant display on ui, is there any problem my code?

TOPICS
macOS , SDK

Views

147

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Jul 06, 2023 Jul 06, 2023

Copy link to clipboard

Copied

You seem to be mixing up plug-ins with executables. You do not load Photoshop plug-ins. You do not run Photoshop plug-ins. Photoshop plug-ins are not installed in /Applications.

 

Photoshop plug-ins are installed into a Photoshop plug-ins folder. They are loaded by Photoshop. They are run by Photoshop, for example when the user chooses a filter or a menu.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 06, 2023 Jul 06, 2023

Copy link to clipboard

Copied

Yes, as you said, I saw an executable file in the plugin directory. Photoshop cant run the plugin,so Im doing some tests.  May I ask if the method I used to load this executable file is correct? Why can't I load the resource file display on UI?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 06, 2023 Jul 06, 2023

Copy link to clipboard

Copied

LATEST

this way can display UI ,but  icons in resource direcotry not display on UI

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines