forked from bengolder/py-adobe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfillShapes.py
More file actions
36 lines (22 loc) · 809 Bytes
/
fillShapes.py
File metadata and controls
36 lines (22 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from appscript import *
from mactypes import *
from InfraPy import *
il = app('Adobe Illustrator')
paths = listFiles("/LocalCodeFullBatch/DNABarsAI", True, fileExtension=".ai")
exportPaths = editFilePrefix("/LocalCodeFullBatch/DNABarsAI/DNABarsAI",
"/LocalCodeFullBatch/DNABarsRefined/DNABarsRefined", paths)
for i in range(len(paths)):
path = paths[i]
export = exportPaths[i]
f = File(path)
il.open(f)
# switches the doc ref to the newly opened document
doc = il.current_document()
items = doc.page_items.get()
for item in items:
color = item.stroke_color.get()
neg = item.filled.get()
item.fill_color.set(color)
item.stroked.set(neg)
doc.save(in_=export, as_=k.Illustrator)
doc.close(saving=k.no)