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

Photoshop not recognising .py (python) file in script>browse.

Contributor ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

I have a python script for Photoshop, a .py file. The instructions to use this file with Photoshop were to go to File>Script>Browse to load the file. When I do this I can see the .py file but it is greyed out and not recognised as a valid script file.

 

Should PS see these .py file as scripts and If so, what is going wrong here.

 

I an using a Mac with lateset OS and latest version of PS Creative Cloud.

 

I hope someone can solve this problem for me.

 

TOPICS
Actions and scripting , macOS

Views

1.2K

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 ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

Hi!

Just wanted to check first--Did you put your script into the Preset>Scripts folder?

Michelle

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
Contributor ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

No, the advice I was goven is just browse for the file at its location. In my case this was the desktop. I can give the presets folder a try but before I do this, I need to look at my other response which seems to indicate that .py files cannot be read directly.

THanks

 

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 Expert ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

Hi!

Here is an article I found that might be helpful. It is dated in 2018, but hopefully the information will still be relevant.

https://lacuisine.tech/execute-python-script-from-photoshop/

Let us know if you are successful!

Michelle

 

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
Contributor ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

I am not the most experienced scripter or coder but what I think this is saying is that you must first develop a javascript script that then calls upon a python script.

The python script I had was written for me by ChatGPT and I wanted to test it out. When it did not work I tried exploring solution options using ChatGPT for advice but nothing seemed to work. I think I have some missing apis or other supporting files, either python version mismatches or photoshop version mismatches.

I think I will park this issue for a while, looking at the ChatGPT code, I am not sure it was going to be that effective anyway for what I wanted. I wanted to see if I could get photoshop to repair a photograph (damaged image of a motorcycle) based on learning from onther clean good image of the same model motorcycle.

 

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 Expert ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

I am not an experienced scripter either, but I wanted to ask yo if you have tried the new Neural Filter in 24 that was just announced? Check out the Newsletter that announced it here: https://community.adobe.com/t5/photoshop-ecosystem-discussions/%EF%B8%8F-photoshop-newsletter-octobe...

 

Look for this title:  Photo Restoration Neural Filter (Beta Feature)

It may not be automated, but it might get you the effects you want.

Michelle

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
Contributor ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

Yes, I have been using Neural Filters, specifically Photo Restoration. This can sometimes work brilliantly, especially on faces, but not all faces. It seems to use a generic database of peoples faces to learn and use so it is a bit hit and miss. If you did not know the people, many results would look ok but if you know the person, sometimes it is just "not right", other times it is spot on.

However, this tool still does not have the ability to be told to learn from specific user supplied examples of faces or things. Maybe in a few years it will have, but not yet.

photoshop (maybe the beta) does have a limited capability to blend two images using user specified common points of matching. At present I think it is a max of 4 points. If this was developed more, you could uses a lkot of matching points so that it could use a good image, transform it to match the proportions of the thing you are trying to repair, then add it as a layer mask and then paint in the areas for repair based on a matched selection. But alas, this is also not available yet bu the technology is nearly there, just not included by adobe as yet.

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
Advisor ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

Hello @nermie,

 

I don't think you can run a .py file directly from Photoshop, I think Applescript needs to be used as a bridge between PS and the .py file.

https://github.com/lohriialo/photoshop-scripting-python

https://github.com/lohriialo/photoshop-scripting-python/tree/master/mac_scripting

 

Regards,

Mike

 

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
Contributor ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

Thanks, I think you are correct. See my response above to Michelle in thread.

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 Expert ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

I will tag some more experienced scripters @r-bin @c.pfaffenbichler @Stephen_A_Marsh 

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
Contributor ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

thanks

 

 

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 Expert ,
Jan 04, 2023 Jan 04, 2023

Copy link to clipboard

Copied

LATEST

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