Need Macro to Watch Folder to Place EPS file in Illustrator

Anyone point me in a useful direction.

I want to create a workflow that watches folders and when an eps file is added it opens Illustrator and places the eps file in a new illustrator file. Obviously then I trigger actions within illustrator to process the file.

The issue I have is trying to figure out how to have a folder watched and then the process of getting newly iinto illustrator.

Can anyone suggest a good resource I can check out?

A good resource is this article in the KM Wiki.

I’m not sure if I understand the “places the eps file in a new illustrator file” and “getting newly iinto illustrator” parts.

You can just open the EPS with Illustrator and then save it as Illustrator file (.ai), no?

In this case something like this will work:


Wow Tom!

Will study this. I need to place rather than open as I have to use Illustrator default setup in order to access swatches and graphic styles.

Obviously I may not need to as I learn more but for now this looks like the way I have to go. But this is really useful as just glancing at it I have learnt something.

Really appreciate your help on this.

Cheers

Michael

Tel: 01274 49009
Mob: 07799622715
Email: michael@makingplans.com
Skype: MichaelTzu
www.makingplans.com

For placing an item into an open Illustrator document you can use an AppleScript action:


Folder Watch and Place [Test].kmmacros (3.5 KB)

Not sure what you do for a living Tom but you should be writing bespoke scripts and automations using KM.

Am in business and sometimes I spend far too long trying to figure something out - having said that I do learn :slight_smile:

Will try these out and let you know how I get on.

Cheers

Michael

Tel: 01274 49009
Mob: 07799622715
Email: michael@makingplans.com
Skype: MichaelTzu
www.makingplans.com

Heck, I just noticed that I’m still using the “old” syntax. Since KM 7.1 we can import variables with getvariable.

So you can replace the first tell block in the AppleScript with this:

tell application "Keyboard Maestro Engine" to set thePath to getvariable "fileToOpen"

Does the same and is much nicer :slight_smile:

Still on version 6 Tom as running ML.

I cannot figure out the trigger - what are you using as trigger?

Cheers

Michael

Tel: 01274 49009
Mob: 07799622715
Email: michael@makingplans.com
Skype: MichaelTzu
www.makingplans.com

Also I have 2 versions of Illustrator but when I try and copy application name - name is same for both so wondering - do I need to set default application to open eps files under Get Info and then changing for all eps files?

Cheers

Michael

Tel: 01274 49009
Mob: 07799622715
Email: michael@makingplans.com
Skype: MichaelTzu
www.makingplans.com

It’s called “Folder Trigger”:


You can use the full path. For example:

tell application "/Applications/Adobe Illustrator CS6/Adobe Illustrator.app"

or

tell application ":Applications:Adobe Illustrator CS6:Adobe Illustrator.app"

Thanks for applescript info.

Below is screenshot of trigger option on my keyboard maestro 6.4.8

No folder option. Maybe not an option on version 6.

Cheers

Michael

Tel: 01274 49009
Mob: 07799622715
Email: michael@makingplans.com
Skype: MichaelTzu
www.makingplans.com

Yes, seems so. Time to update the OS.

If not, …

  • try to get an older version of Hazel (the current version requires 10.10)
  • try to use the system’s Folder Action

Yep

Will try with Hazel as good option.

Thanks for that Tom.

Cheers

Michael

Tel: 01274 49009
Mob: 07799622715
Email: michael@makingplans.com
Skype: MichaelTzu
www.makingplans.com

I just tried it with Folder Actions and it works, too. It only crashed the Finder once :wink:

  1. Copy your full Illustrator path into the script below (tell application "<path>Adobe Illustrator.app").
  2. Copy the script to ~/Library/Scripts/Folder Action Scripts/
  3. Open the AppleScript menu in your menu bar and select Folder Action > Attach Script to Folder.
  4. Select the script.
  5. Select the folder where you want it attach to (the watched folder).

AI Test.scpt.zip (4.2 KB)

Michael, welcome to Keyboard Maestro! It's a great tool that can be used for a wide variety of purposes.

Your topic is not at all off-topic, so you may want to revise the topic title to something more representative of the question.

I see you are still on KM 6. I recommend upgrading to KM 7 as soon as you can -- there are lots of benefits and new features.

I don't know how familiar you are with KM, but maybe this will be helpful:
(some of this may require KM 7)

Getting Started with Keyboard Maestro

  • Read the Quick Start.
    • This is essential to become familiar with KM terminology
  • Do the tutorial (Help ➤ Tutorial) in the KM Editor.
    • Gives you a live walkthrough of creating a macro in the KM Editor
  • Review/Browse the Available Macro Actions
  • For Help with an Action in your Macro, click on the gear icon at the top right of the Action, and select "Help"
  • Start small, and grow your macros organically.
  • Be prepared for some trial and error in the beginning.
  • Make good use of this Keyboard Maestro Forum
    • Search for existing macros
    • Post your questions/issues if you get stuck

He mentioned that he's still on Mountain Lion, and v7 doesn't work on Mountain Lion, right? Just want to make sure.

KM 7 requires Yosemite+ (10.10.3+)

Maybe he can’t upgrade his Mac OSX, but I still recommend doing so if possible.
I also recommend El Capitan (but not the latest 10.11.5. I’m staying on 10.11.4 until some issues are fixed)

Thanks everyone for input. I am running 10.11 on other drive but ML is still main drive for now. However, over weekend will try on 10.11.

Cheers

Michael

Seriously? ML is the best OS X version ever, second only to Snow Leopard! (Heavily joking.)

No, if you don’t update macOS you’ll end up with a disk full of outdated software rather sooner than later. And it would really be a shame to miss out on KM 7. Just look at the new-features list.

OK everybody sitting down?

We are still using Tiger on PPC G5’s!!

If it aint broke don’t fix it. But of course we have to move with the times :slight_smile:

Just had to fork out several £K’s for software upgrades so now we have to bite the bullet.

Most of what I am doing with KM is personal stuff to get my head round it as will have to reinvent all the QuicKeys at some stage.

But be fun learning.

Michael

1 Like

:open_mouth: