Jump to content
You must now use your email address to sign in [click for more info] ×

What programming Language is Affinity Designer written in?


Recommended Posts

  • Staff

Hey guys, 

 

Just out of curiosity what programming language is Affinity Designer and Photo written in for Windows? You guys using C++

 

Are we going to be able to write our own scripts with Python by any chance? as it's a bit simpler than Javascript I find.

 

Thanks :)

 

Affinity is mainly written in C++ with the Mac version front-end written in Objective C. Scripting will be Java script as we feel this will cover the largest use cases people want.

Link to comment
Share on other sites

I would also prefer python, but javascript is good also.

When will we get scripting available? Any timeframe?

And, will the scripting just be a glorified "macro" with possibility to add conditionals or will we be able to add new tools and/or commands through scripting?

Great question, I would like to know this also.  :)

Link to comment
Share on other sites

  • 3 months later...

interesting choice for JavaScript.

 

most design tools I use use Python for scripting Maya Blender Fusion ...

 

add Krita to that.

I too would be much more excited about Python, not so much for Javascript. I guess it's another reason for me to learn Javascript even though I'm not too thrilled with it.

Link to comment
Share on other sites

add Krita to that.

I too would be much more excited about Python, not so much for Javascript. I guess it's another reason for me to learn Javascript even though I'm not too thrilled with it.

 

I don't mind learning scripting languages. Javascript tutorials are easy to find. After searching, so is python. Codeschool.com and Codecademy.com are two good resources to learn either. These are what I will use.

Link to comment
Share on other sites

I don't mind learning scripting languages. Javascript tutorials are easy to find. After searching, so is python. Codeschool.com and Codecademy.com are two good resources to learn either. These are what I will use.

 

I was using Codecademy for awhile, but their Python course is using version 2, I don't mind being familiar with the syntax differences, but I would ultimately rather not be learning on an old version. I also like FreeCodeCamp and will probably use both that and Codecademy when I do get around to picking up Javascript.

Link to comment
Share on other sites

From a programmers point of view there is nothing wrong with choosing Javascript, it's widely used and every browser has nowadays a halfway good working JS engine underneath. Also they will be in good company, since all mayor players (MS, Apple, Adobe, Google ...) do use it too in the one or other way. Performance wise JS is also slightly faster than Python.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

  • 2 weeks later...

Just found this topic  :blink:  anyway delighted to hear that a scripting language will definitely be implemented in AD/AP. I'm somewhat surprised but happy it will be JavaScript, one less thing to learn! I'd really be able to integrate this into some projects at work (ie a business copy just on that one feature)
 
The big question though.... WHENNNN!!!!

Link to comment
Share on other sites

  • 3 weeks later...

Affinity is mainly written in C++ with the Mac version front-end written in Objective C. Scripting will be Java script as we feel this will cover the largest use cases people want.

 

I just saw this – having done scripting in both languages in different applications, I really, really, really hope this will be reconsidered when the time comes for that feature to be implemented.

 

I'm actually a bit surprised to read that statement since I literally can't think of any use case that JavaScript covers chat Python doesn't, usually even cleaner and easier.

 

Even basic things like splitting code into multiple source files and deriving from classes provided by the host application (say, MenuCommand, UiPanel, or FillerTextGenerator) are maddening and frustrating experiences in JavaScript, if they are possible at all.

 

Imagine use cases like a basic InDesign IDML importer for Affinity Publisher. With an existing Python XML parser package, this is a fairly straightforward task. Or a "Place Article from RSS feed" command. Network access and RSS feed parser come standard with Python without installing anything and would make that type of thing a matter of only a few lines of code. With Adobe-type JavaScript scripting, I'd probably give up the idea of writing that script before even starting.

 

Not to mention you guys would have a much easier time developing and maintaining the C++ host side if you can use boost::python versus some raw JavaScript engine API.

 

Also, JavaScript will likely run scripts in separate engine instances for each script to avoid clashing function names and the like, making it really hard to communicate between different scripts, share code between commands and so on. Even running specific functions defined in a script file from the interactive script console etc. may be impossible.

 

I realize that some folks favor JavaScript because they are already familiar with it, but I don't see how someone who is used to JavaScript wouldn't be able to easily pick up the necessary Python basics within a matter of minutes and be at a point where they could write pretty much everything they could in JavaScript in Python as well.

 

The only real issue I see with Python is that all that power may clash with Apple's AppStore sandboxing rules.

Link to comment
Share on other sites

  • 1 month later...

Hello everyone, I do not believe that affinity can be written in c++, but rather in c# considering the windows uwp cannot be modified in c++ and that in wpf one can do it or in winform and I believe even they use visual studio with framework .NET if you look at the files well and same the .dll can be referred in c#. I have to even try to take again the same window and I made a success of it.

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.