Embedded Icon Support

Issue #106 new
Rafi Khan created an issue

#Scenario# Script authors on aescripts.com have their own graphics/icons/assets that they might want to include as part of their script if it runs in KBar. There should be a simple way to embed this into the script itself.

Idea 1

When a user creates an invoke script file or scriptlet button and presses save or test in KBar it can scan the code for a large comment block that contains metadata about the script. The metadata can contain things like a default icon name, a default image in the form of a path or simply be base64 encoded directly in the file. Since the conversion happens in CEP this would be a very fast operation.

Pro: You don't have to run the full script to get the image data. Con: You can only set the initial image.

Idea 2 (from Lloyd)

Expose an API that can set the button icon at runtime.

Pro: The author can change the icon at runtime. This opens up really cool possibilities.

Con: No way to discover the default icon without running the script. This is a weird user experience.

Idea 3

Do both Idea 1 and 2. This might be a weird experience for the script author?

Comments (14)

  1. lloydalvarez

    I like the idea of a metadata section but not sure how you could read this since the script file will be jsxbin encoded. I think runtime is our only option because of this.

  2. lloydalvarez

    Actually, one way would be to have the metadata in the cloud somewhere and you would check it against the script name when the user creates the button in KBar. What do you think about this?

  3. Rafi Khan reporter

    Ah, you're right. I forgot about jsxbin. The only way around it is if the author included something like a "name_of_script.kbar" along side the script itself. I could probe for that in the script folder and load icon or any other data from there.

    So for the cloud idea, that's actually the plan I have for KBar 2.0. A user will be able to export and save any button/toolbar(s), put it in a place like github gist or bitbucket snippets and Kbar will pull it down and/or synchronize it. Something like that.

  4. lloydalvarez

    Ah, you're right. I forgot about jsxbin. The only way around it is if the author included something like a "name_of_script.kbar" along side the script itself. I could probe for that in the script folder and load icon or any other data from there.

    Yes, sidecar file is definitely the easier option. Only downside i can think of is that it gets separated during install, but I think any user that is doing this is smart enough to not let this happen. Why don't we go for this option until you do the cloud option in v2. Want me to design the schema?

    So for the cloud idea, that's actually the plan I have for KBar 2.0. A user will be able to export and save any button/toolbar(s), put it in a place like github gist or bitbucket snippets and Kbar will pull it down and/or synchronize it. Something like that.

    Yes, this will be huge!! I am already moving the old ft-Toolbar snippets to github gists with these hastags: #AfterEffects #Script #KBar https://gist.github.com/search?utf8=%E2%9C%93&q=%23AfterEffects+%23Script+%23KBar

  5. Remco Janssen

    I like the idea of a metadata section but not sure how you could read this since the script file will be jsxbin encoded.

    This would be possible by saving a jsx with the metadata in a comment at the top and then evaling the jsxbin string.

    Because you don't really want extra files…

    Only downside i can think of is that it gets separated during install

  6. Rafi Khan reporter

    This would be possible by saving a jsx with the metadata in a comment at the top and then evaling the jsxbin string.

    @lloydalvarez - @klustre is right. It can be tacked onto the top/bottom of the jsx(bin) file. You think authors will be down with this approach?

  7. lloydalvarez

    If we could make some kind of build script to automate this then yes I think it's a great idea.

  8. Rafi Khan reporter

    Assuming jsxbin supports it Automating a script around this (or even a web page will be very easy)

  9. Log in to comment