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

Recommended Posts

1 minute ago, Bryan Rieger said:

anything but AppleScript

It's just my personal wish because that's the only scripting language I somewhat understand. I doubt I'd still have the patience to dive into learning JavaScript or anything else at that point in my life when/if Affinity scripting would be implemented. Which I don't expect to happen in three, two, one…
I'm not holding my breath either way.

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

I think the language should be Swift! After learning Swift I don't want to use any other programming language anymore!

♥️Affinity v2; macOS 14; ⌨️🖱; recreational user since 2014.

Link to comment
Share on other sites

If they (will?) do it right, you could choose any language that's capable to comunicate with the respective scripting host of your OS. You can write Apple Scripts in Apple Script or JavaScript, on Windows you can script with VBScript, JavaScript or Python, for example.

Photoline for example is scriptable(!) and can be addressed by any scripting engine that the Windows Scripting Host supports. BTW, it's developed by just two guys!

Link to comment
Share on other sites

  • 5 weeks later...

I have used so many languages I've lost count, starting with Fortran on punch-cards. The "best" of these is Python for several reasons:

  • Low cognitive overhead: you can pick up the basics in no time.
  • Readability: I can walk back to code written a decade ago and understand it perfectly.
  • Adaptability: skills I learn in one domain are just as applicable to another.
  • Popularity: there's lots of people already familiar with the syntax.
  • Ubiquity: works on every platform.

A second choice would be Javascript, which is moderately good at the above.

But nothing with the word "Apple" in it, please. Why would anyone commit to any of their products? A couple years down the line they will deprecate all your hard work.

Link to comment
Share on other sites

On 5/5/2021 at 12:35 PM, hawk said:

I think the language should be Swift! After learning Swift I don't want to use any other programming language anymore!

Swift looks like a mashup of Java and Python. You don't need semicolons but you do need braces. You can't have heterogeneous lists, but you do have a different type for this functionality. Slower than Objective-C but more cumbersome than Python, missing the extensive library and platform support. Seems like a solution looking for a problem, unless you are exclusively an iOS developer.

Link to comment
Share on other sites

On 6/4/2021 at 11:17 PM, rparmar said:

You don't need semicolons but you do need braces.

And one can easily write multiline lambdas/closures in Swift thanks to that, unlike Python.

On 6/4/2021 at 11:17 PM, rparmar said:

You can't have heterogeneous lists, but you do have a different type for this functionality.

You can. It's not as frictionless in Swift, but you can get the same behavior of Python with type erasure and forced down-casting.

Ideally you'd mix types based on a common trait (protocol), though that has limitations at the moment. It is work in progress.

On 6/4/2021 at 11:17 PM, rparmar said:

Slower than Objective-C

But still faster than Python, right?

On 6/4/2021 at 11:17 PM, rparmar said:

but more cumbersome than Python

Debatable.

Swift has excellent type inference, function overloading, full-fledged struct and enum types, and safety features that make debugging easier.

Along with argument labels, this makes it possible to design a really nice, natural API for Affinity.

On 6/4/2021 at 11:17 PM, rparmar said:

missing the extensive library and platform support

Swift is cross-platform, supported by popular editors like VSCode, and has a growing package ecosystem with an official package registry on the way.

There's also PythonKit (based on Swift for TensorFlow) that would allow you to "use Python APIs as though they are directly embedding Python itself".

So there's no need to fear missing out.

Swift is a beautiful, modern language that could be an unusual but innovative choice for Affinity. It could be a bit risky, but I believe it would be for the better in the long run. It will be easier to write and maintain bigger scripts with Swift's sophisticated static type system, which can only be clunkily retrofitted to Python, and the ergonomic advantages of Python in smaller scripts are negligible!

Availability of existing libraries and familiarity should be considered Python's biggest advantages, but Swift is easy to learn and can be bridged with Python libraries.

♥️Affinity v2; macOS 14; ⌨️🖱; recreational user since 2014.

Link to comment
Share on other sites

22 hours ago, hawk said:

And one can easily write multiline lambdas/closures in Swift thanks to that, unlike Python.

I'm pretty agnostic when it comes to what language Affinity should select for scripting.

That said, I'd rather strongly prefer them to select a fully non-proprietary language.

Swift is deeply tied to Apple's ecosystem, and Apple drives that standard. I'd be just as opposed to TypeScript, for the same reasons—they may pretend to be open-source, but they're subject to the whims of those proprietors, and their priorities are always going to favor what's good for the corporation over what's good for the community.

After all, many of us really liked AppleScript, and what happened to that?

Link to comment
Share on other sites

Python or javascript, as it works in any platform.

If I create a script/tool I wan't it to be available on MacOs, iOS and Windows, without having to re-code it.
I also don't want to look out for scripts/tools and realize that they only work for an OS that is not the one I'm using.

Link to comment
Share on other sites

On 6/11/2021 at 9:32 PM, hawk said:

Swift

That post really reads like an advertisement.

I think we've kinda agreed that having a language-agnostic API would best for both Serif and their users. Its risk-free, future proof, and lets users use whatever language they like.

The real important question is, are we getting this feature, and if yes, when.

Link to comment
Share on other sites

The most glaring omission in the Affinity suite is scripting support.

I was hoping for a standard OSA scripting dictionary as Acorn, Pixelmator Pro, MacVim, Emacs and VLC have. That way I could easily script it using AppleScript or JavaScript (JXA - JavaScript for Automation).

QuarkXpress was famous for its extensive AppleScript support.

Adobe has decided to use JavaScript as its internal scripting language. Their OSA scripting dictionary only offers "run script" as an external command.

I have no respect for Python. I thought we gave up that cockamamie "structure for the sake of structure" with COBOL. Though the GIMP and Blender use it for their scripting language.

If you can't offer an OSA scripting dictionary (AppleScript/JXA), then how about going the Adobe route and using JavaScript?

Both AppleScript and JavaScript were inspired by HyperTalk to allow easy user scripting.

Link to comment
Share on other sites

1 hour ago, dotHTM said:

Another forum request asks for interior text formatting on import such as Data Merge, and a workaround was suggested of just using HTML formatting tags, and find/replacing them with regex and the appropriate formatting changes. (e.g. Find regex "<em>(.*?)</em>" and replace with "$1" and set the emphasis style on replacement.)

This was workaround was quickly noted for being a lot of manual work, and in general it's prone to error

I agree. In fact in the very first post of this thread I mentioned that tagged text goes hand in hand with scripting and needs to be supported for automated import of text. I'm not holding my breath for either. I don't think people or companies who use automation are the target audience of Affinity. They seem to be content serving individual users rather than businesses or companies.

Link to comment
Share on other sites

  • 2 weeks later...

As someone new to the Affinity suite of apps (hi all :)), but with rather a long time of using ExtendScript for InDesign (and a weeny little bit for Illustrator + Photoshop as well), I am waiting eagerly to see what happens with Publisher. I couldn't agree more with kimtorch here, in your last post - a tagged text of some kind, encompassing any and all possible formatting of the text, and preferably also (like ICML) being able to handle inline objects, that would be very very good.

Link to comment
Share on other sites

On 7/8/2021 at 1:58 PM, zixdesign said:

As someone new to the Affinity suite of apps (hi all :))

Hello @zixdesign,

well, I can't add anything about scripting. But at least I want to give you a warm welcome to the forum. Cheers!

d.

Affinity Designer 1 & 2   |   Affinity Photo 1 & 2   |   Affinity Publisher 1 & 2
Affinity Designer 2 for iPad   |   Affinity Photo 2 for iPad   |   Affinity Publisher 2 for iPad

Windows 11 64-bit - Core i7 - 16GB - Intel HD Graphics 4600 & NVIDIA GeForce GTX 960M
iPad pro 9.7" + Apple Pencil

Link to comment
Share on other sites

On 3/15/2020 at 10:56 PM, Jose Alvarez said:

One more vote to Python.

Despite the fact I'm a Indesign scripter long time ago, I think Python is a more powerful, cross platform language. Not JS for WINDOWS and AS for OSX, one ring to rule them all  ;)

Greetings from Spain!

not to mention it's one of the most ( if i not the most )  common scripting language in vfx pipelines with most commercial vfx software offering a python API. While not the same target group it would make sense in my book to go the same route. 

Link to comment
Share on other sites

  • 4 weeks later...
On 7/11/2021 at 5:14 PM, dominik said:

Hello @zixdesign,

well, I can't add anything about scripting. But at least I want to give you a warm welcome to the forum. Cheers!

d.

Thanks a lot, @dominik :) Back @ work again, will follow this with interest as it unfolds.

Edited by zixdesign
Link to comment
Share on other sites

  • 2 weeks later...

Holy cow.

I just read 11 pages of opinions stretching back 3 years giving Serif all kinds of advice about which flavor of programming language, how proprietary (or not) that language or languages should be, etc. Tip o' the cap to all of you who have brought nuance to that part of the problem.

I have been able to accomplish some amazing tasks over the past 35 years using automation tools. If it wasn't available directly in the application, there were hooks to allow an external tool to accomplish programmatic tasks.

Given that some kind of implementation is needed, and that it involves choices, I want to step aside from that detail and state:

  • Some form of scripting would vault AP and its suite-mates into the professional tool arena. It's just not there without it.
  • Some form of macro editing/creation, as with Photo, would ease the pain of text manipulation.
  • Some form of saving find/replace expressions for reuse would make it worthwhile to use RegEx/GREP strings.

I list those items from most to least difficult (in my naive understanding). In order of implementation priority, I'd reverse the list.

Surely Serif could pick off one or more items from that list and realize a huge gain in adoption (for Serif) and productivity (for users).

 

-- 

Matt

 

Link to comment
Share on other sites

On 8/22/2021 at 8:22 PM, Bikerbudmatt said:

realize a huge gain in adoption (for Serif) and productivity (for users).

For sure.

For example, in another app, I decided to recreate all the technical sheets we send to clients. There's 4 pages, but only the 1st and the 2nd have different text.

So I created a document with 1 base layer for the text that stay the same, and ±25 other layers for the differents datas, named accordingly.

I just had to create a script with different options:

  • to export the layers' names as a variable in a text file that I completed,
  • to memorize some other datas like the different export paths depending of the opened document (I needed different documents for different categories),
  • and able to hide all the layers but the bottom base one, and in turn, display each layer, export the PDF with the appropriate name, hide it and display the next layer, etc.

It was easy then to add new documents for translation, and modify again the script to export all the needed layers of all opened documents at once. I just need to run the script, select an option, and OK, voilà!

With this, I can easily correct typos or datas, add new informations and get new PDF.

 

I hope they thought from the start about adding scripts, since it's a really important feature.

Link to comment
Share on other sites

On 6/11/2021 at 3:32 PM, hawk said:

Swift is a beautiful, modern language

Modern isn't always a good thing, and "beautiful" is debatable.  Anything that uses braces instead of spelled out words as block delimiters gets my downvote.

Link to comment
Share on other sites

i vote python.  it's simple and straightforward.

 

Base Unit: I5 (10th gen.), 6 cores, 12 threads, 24GB Ram, 256GB SSD (Boot), 1TB HDD, Intel 630 (Graphics), Colour Calibrated Monitor and Printer (Courtesy of X-Rite Hardware) - Running MacOS Monterey

Laptop: I5 (6th Gen), 8GB Ram, 128GB nvme, Intel 520 Graphics, Colour calibrated screen(Courtesy of X-Rite Hardware) - Running MacOS Monterey.

Server: i5 (4th Gen). 16GB Ram, nVidia GT 730 (Graphics), 500GB SSD (Boot), 2TB & 1TB HDD (General storage), Running MacOS Catalina
 

Link to comment
Share on other sites

On 8/22/2021 at 8:22 PM, Bikerbudmatt said:

Holy cow.

I just read 11 pages of opinions stretching back 3 years giving Serif all kinds of advice about which flavor of programming language, how proprietary (or not) that language or languages should be, etc.

I feel you, it was the same for me.

The programming language question used to be a legitimate concern due to specialist availability, but I think it's been solved a few posts ago (recommendation for language-agnostic API).

For some reason people still find it necessary to post their preferred languages. At least the thread gets bumped, I guess.

I'm subscribed in hope that we'll get an update from Affinity about the feature, but I'm not getting my hopes up.

We had a time window at work where we could have started using - or planned for - Affinity apps in the pipeline, but that's no longer the case.

Now I'm just curious if the feature gets released, and if yes, will it'll bring some interesting stuff to the table that I could use personally.

Link to comment
Share on other sites

10 hours ago, michalmph said:

I feel you, it was the same for me.

 

…We had a time window at work where we could have started using - or planned for - Affinity apps in the pipeline, but that's no longer the case.

 

 

On 8/22/2021 at 5:38 PM, Wosven said:

For sure.

For example, in another app, I decided to recreate all the technical sheets we send to clients. There's 4 pages, but only the 1st and the 2nd have different text.

So I created a document with 1 base layer for the text that stay the same, and ±25 other layers for the differents datas, named accordingly.

I just had to create a script with different options:

…I hope they thought from the start about adding scripts, since it's a really important feature.

Yes, and yes. I had to turn back to InDesign CS6 (last version with a standalone license) today to start producing the latest iteration of a long-standing project that requires a RegEx search and replace. First pass to catch all instances of a certain numeric string and reformat it using a character style followed by a non-breaking space to attach it to the next word, then a second pass to catch just the leading instance of that string in each paragraph and reformat it with a different character style. ID has the following features that make this a 1-second task, even on the old iMac that is running it:

  • Fully supported and documented RegEx implementation
  • Find and replace strings that can be stored and recalled globally
  • Full scriptability
  • Extensible interface to allow the script to be compiled in Java and invoked at will

And all of that from software that was released nine years ago. Early CS versions could do the same.

The reason I had to use ID (and had to do it remotely, because the mid-2012 iMac is in another office) is because I can find no other software that will do what I need and bring the results into Affinity Publisher. BBEdit? Only supports text or markup for output, so the amazing RegEx "Playground" is wasted because it can't provide useful output. Microsoft Word? It would seem like an obvious choice, but support for regular expressions (which they call "Wildcards" but which was a reasonable implementation of RegEx) has eroded to the point where it has disappeared from the documentation. And, since AP doesn't seem to support tagging, either, there's no sense in writing a BBEdit text factory to attach markup tags to text.

Lack of tagging support seems especially weird because of all the effort that has gone into the IDML import filter. I'm really hopeful that an LED lightbulb will go off in the developers' heads, because they must be that close to supporting tagging in general.

So again, as @michalmphpoints out, we don't need to solve the "which language" problem for Serif, but I for one would really love to retire that old iMac from its production job so it can serve household files for the next 10 years! 

-- 

Matt

 

Link to comment
Share on other sites

10 hours ago, Bikerbudmatt said:

First pass to catch all instances of a certain numeric string and reformat it using a character style followed by a non-breaking space to attach it to the next word, then a second pass to catch just the leading instance of that string in each paragraph and reformat it with a different character style.

For what it's worth, I believe the RegEx support in Publisher would have handled that, too.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

23 hours ago, michalmph said:

For some reason people still find it necessary to post their preferred languages. At least the thread gets bumped, I guess.

I think it's because this is the humour thread, every board needs to have one.

With that in mind, I'll cast my vote for Rexx! 🙂

Download a free manual for Publisher 2.4 from this forum - expanded 300-page PDF

My system: Affinity 2.4.0 for macOS Sonoma 14.4, MacBook Pro 14" (M1 Pro)

Link to comment
Share on other sites

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.