0
votes

I am very new to both automator and applescript. I have created an application that uses automator to print file(s) that are dragged and dropped onto the program icon. it is very simple. In automator, I just run

Print Finder Items

and the program works. Now I need to do more complicated things and I need to figure out how to convert that one command into applescript. I've tried the advice given in multiple stack overflow articles including: Automator to Applescript for Editing Code but it does not help me. How do I convert this to applescript?

1

1 Answers

1
votes
tell application "Finder"
    set theItems to selection
    print theItems
end tell

You need to learn how to find the commands yourself so you can explore what they do. Open AppleScript Editor. Under the File menu choose "open dictionary" and select the Finder. This dictionary tells you everything you can do with applescripting the Finder. Each application has its own dictionary so you need to start looking at these.

That script works on any files you select in the Finder. Good luck.