-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac Scripting guide suggestion #14
Comments
Agreed. You have to grab the file path somehow by placing it into a Also, I would like to add, if you have trouble finding the docs for If anyone knows of something like |
I would be more than happy to contribute to some documentation and sample code for macOS scripting with appscript. It is not abandoned, but in minimal maintainance mode, i.e. fully functional, but there are no new features planned — which is to be expected for 20 year old, mature software that fulfils its purpose perfectly. Since appscript also fully wraps Apple Events, for as long as Apple Events are the way macOS scripting is done, it will always be fully functional. And yes, appscript.sourceforge.com is the correct site for appscript's documentation, but it is worth noting that the docs are very verbose and focused less on how to use the bridge, than how it works behind the scenes. If you just want to script in Photoshop, then reading through the quick tutorial on how to translate AppleScript syntax to appscript, then reading the Photoshop scripting dictionary in the Script Editor app is the way to go. As for referencing realative file paths and passing them to Photoshop to open, you can use Python's pathlib module to create a Path object, then use that object's absolute() function to get a string of the absolute path, then pass that to the open command like so: from pathlib import Path
from appscript import app
ps = app(id="com.adobe.Photoshop", terms="sdef")
file = Path("some/relative/file.png")
ps.open(file.absolute()) Or you can use the import os
from appscript import app
ps = app(id="com.adobe.Photoshop", terms="sdef")
file = os.path.abspath("some/relative/file.png")
ps.open(file) |
I’m trying to follow your mac scripting guide. https://github.com/lohriialo/photoshop-scripting-python/tree/master/mac_scripting
In usage:
What
file_name
is referring to is unclear. It would be better if you change it to:The text was updated successfully, but these errors were encountered: