Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

How to open files in repeat loop in Photoshop

$
0
0

So, I’m a completely newbie on this applescript thing. 

What I’m trying to archive with this script that runs in a automator-watched folder is:

 

If image(s) file(s) is added to this specific folder do this:

1. Create a new folder

2. Give the folder the same name as the new file

3. Move the file to the corresponding folder.

 

So far, the steps above I manages to archive, but:

 

The next step I want to be able to do is to open the moved file in Photoshop and run a photoshop action on it. I’ve tried “open this_file” but it doesn’t open it. Any ideas on how to solve this?

 

this is my script:

 

-------------

 

onrun{input,parameters}

tell
application"Finder"
set
mlisttoeveryfileoffolder"Macintosh HD:Users:matrik:Desktop:drop" whose (nameends with ".jpg" ornameends with ".jpeg" ornameends with ".png" ornameends with ".gif")
repeatwith
this_fileinmlist
set
cur_exttoname extensionofthis_file
set
new_nametotext1 thru -((lengthofcur_ext) + 2) of (nameofthis_fileastext)
set
new_foldertomakenewfolderwith properties{name:new_name}atfolder"Macintosh HD:Users:matrik:Desktop:drop"

movethis_filetonew_folder

set this_file to this_file as alias


tell application "Adobe Photoshop CC 2014"

activate

open this_file <-- Is this what I'm doing wrong?

do action “cool effects" from “my effects"

end tell

endrepeat
endtell

return
input

endrun


Viewing all articles
Browse latest Browse all 12244

Trending Articles