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

My plugin on mac and on windows works different. Why?

New Here ,
May 15, 2015 May 15, 2015

Copy link to clipboard

Copied

Hi!

I'm writing a PS Plugin and I see that it's working different on mac and on windows. Can anybody explain why?

More about it:

I create new text layer and style it. Then I push button on my plugin which run script. This script gets json data with a list of texts from server. Then it iterates through this list and doing next:

- Creates a duplicate of existing styled layer;

- Changes text of duplicated layer to text from my list;

- Saves this layer as PNG image.

- Sends this image to server.

- Deletes image.

This process repeats for each text in list. And after ask for another batch of json data from server.

I've tested this on Mac OS and on Windows machines. And result time for mac was 2-4 times bigger then time on windows.

TOPICS
Actions and scripting

Views

201

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
Community Expert ,
May 16, 2015 May 16, 2015

Copy link to clipboard

Copied

Do you really mean a plugin or do you mean a Script?

Even if you should be talking about a Script but do not feel like posting the code it might be difficult to try and help you.

And if you are talking a bout a plugin (C++ or whatever) this may not be the ideal Forum for addressing the issue.

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
Enthusiast ,
May 16, 2015 May 16, 2015

Copy link to clipboard

Copied

LATEST

It might "be a feature" if the outcome is the same on both.. My experience is that Javascript performance is pretty equal in Win & Mac (latter being slightly better). But there might be specific things that perform very differently. You should drill down on the difference, is everything slower or just some specific spot. If you find specific part that has a big difference, post it back here.

A couple of pointers that might or might not be relevant (since you might be doing going through all layers):

  • The "collection.length" is not actually a variable but counts the lenght in real time every time it's called. So always when iterating through a collection, store length in local variable and don't do a "for (var i=0; i<collection.length; i++)"
  • It's faster to use foo.layers than foo.artLayers or foo.layerSets. If you just want to iterate art layers, you should still use .layers and add an if to chekc if it's an art layer

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