Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/active_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
docRef.artLayers.add()

# Display current active layer name
ps.echo(docRef.activeLayer.name)
print(docRef.activeLayer.name)

# Create and rename a new layer
new_layer = docRef.artLayers.add()
ps.echo(new_layer.name)
print(new_layer.name)
new_layer.name = "test"
2 changes: 1 addition & 1 deletion examples/add_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
doc.info.provinceState = "Beijing"
doc.info.title = "My Demo"
print("Print all metadata of current active document.")
ps.echo(doc.info)
print(doc.info)
4 changes: 2 additions & 2 deletions examples/change_color_of_background_and_foreground.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
ps.app.backgroundColor = bg_color

# Print current colors
ps.echo(f"Foreground RGB: {ps.app.foregroundColor.rgb.red}, "
print(f"Foreground RGB: {ps.app.foregroundColor.rgb.red}, "
f"{ps.app.foregroundColor.rgb.green}, "
f"{ps.app.foregroundColor.rgb.blue}")

ps.echo(f"Background RGB: {ps.app.backgroundColor.rgb.red}, "
print(f"Background RGB: {ps.app.backgroundColor.rgb.red}, "
f"{ps.app.backgroundColor.rgb.green}, "
f"{ps.app.backgroundColor.rgb.blue}")
2 changes: 1 addition & 1 deletion examples/compare_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
color1.rgb.green == color2.rgb.green and
color1.rgb.blue == color2.rgb.blue)

ps.echo(f"Colors are {'same' if is_same else 'different'}")
print(f"Colors are {'same' if is_same else 'different'}")
6 changes: 3 additions & 3 deletions examples/convert_smartobject_to_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@

# Convert to smart object
layer.convertToSmartObject()
ps.echo("Layer converted to Smart Object")
print("Layer converted to Smart Object")

# Check if it's a smart object
if layer.kind == ps.LayerKind.SmartObjectLayer:
ps.echo("Layer is now a Smart Object")
print("Layer is now a Smart Object")

# Convert back to regular layer
layer.rasterize(ps.RasterizeType.EntireLayer)
ps.echo("Smart Object converted back to regular layer")
print("Smart Object converted back to regular layer")
2 changes: 1 addition & 1 deletion examples/current_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
current = ps.app.currentTool

# Print current tool name
ps.echo(f"Current tool: {current}")
print(f"Current tool: {current}")
2 changes: 1 addition & 1 deletion examples/eval_javascript.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
# Execute JavaScript command
js_code = "app.documents.length"
result = ps.app.eval_javascript(js_code)
ps.echo(f"Number of open documents: {result}")
print(f"Number of open documents: {result}")
2 changes: 1 addition & 1 deletion examples/export_layers_use_export_options_saveforweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def main():
image_path = os.path.join(layer_path, f"{layer.name}.png")
doc.exportDocument(image_path, exportAs=ps.ExportType.SaveForWeb, options=options)
ps.alert("Task done!")
ps.echo(doc.activeLayer)
print(doc.activeLayer)


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions examples/get_document_by_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Try to get document named 'test.psd'
for doc in ps.app.documents:
if doc.name == "test.psd":
ps.echo(doc.name)
print(doc.name)
break
else:
ps.echo("Document not found!")
print("Document not found!")
2 changes: 1 addition & 1 deletion examples/get_layer_by_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
doc = ps.app.activeDocument
for layer in doc.layers:
if layer.name == "example layer":
ps.echo(layer.name)
print(layer.name)
break
6 changes: 3 additions & 3 deletions examples/link_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
layer2.link(layer3)

# Check link status
ps.echo(f"Layer 1 linked: {layer1.linked}")
ps.echo(f"Layer 2 linked: {layer2.linked}")
ps.echo(f"Layer 3 linked: {layer3.linked}")
print(f"Layer 1 linked: {layer1.linked}")
print(f"Layer 2 linked: {layer2.linked}")
print(f"Layer 3 linked: {layer3.linked}")

# Move linked layers together
layer1.translate(100, 100)
2 changes: 1 addition & 1 deletion examples/open_psd.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

# style 2
with Session("your/psd/or/psb/file_path.psd", action="open") as ps:
ps.echo(ps.active_document.name)
print(ps.active_document.name)
2 changes: 1 addition & 1 deletion examples/operate_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# List all channels
for channel in doc.channels:
ps.echo(f"Channel: {channel.name}")
print(f"Channel: {channel.name}")

# Create a new alpha channel
new_channel = doc.channels.add()
Expand Down
4 changes: 2 additions & 2 deletions examples/operate_layerSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@

# List layers in groups
for layer in main_group.layers:
ps.echo(f"Layer in main group: {layer.name}")
print(f"Layer in main group: {layer.name}")

for layer in sub_group.layers:
ps.echo(f"Layer in sub group: {layer.name}")
print(f"Layer in sub group: {layer.name}")

# Move a layer between groups
layer1.move(sub_group, ps.ElementPlacement.INSIDE)
2 changes: 1 addition & 1 deletion examples/session_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ def on_close():


with Session(callback=on_close) as ps:
ps.echo("Working in session...")
print("Working in session...")
2 changes: 1 addition & 1 deletion examples/session_new_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@


with Session(action="new_document") as ps:
ps.echo(ps.active_document.name)
print(ps.active_document.name)
18 changes: 0 additions & 18 deletions photoshop/api/_active_layer.py

This file was deleted.

Loading