Simple Script Needed

55 views
Skip to first unread message

Muffin

unread,
Nov 13, 2014, 4:45:29 PM11/13/14
to multiad...@googlegroups.com
Hi,

I need a script to convert our jobs to two different formats without having to do this manually. A user would pull up a job, review it, then make a PDF of it and save it to a server (and the PDF would include the page setup area), and then make an EPS file of it and saved to another server (and the EPS would only include the job itself, just the ad size area). I was wondering how I could get a script like this made.

Even if the formats were saved just to a folder on the desktop, that would still save us a lot of time.

If anyone has any ideas, it would be greatly appreciated. Thanks.

Steve Bowden

unread,
Nov 13, 2014, 5:13:57 PM11/13/14
to multiad...@googlegroups.com
I think you may be able to accomplish this with Graphic Converter


http://www.lemkesoft.de/en/products/graphicconverter/download/

--
--
You received this message because you are subscribed to the "MultiAd Creator User Group" group.
To post to this group, send email to multiad...@googlegroups.com
To unsubscribe from this group, send email to
multiadcreato...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/multiadcreator?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "MultiAd Creator User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to multiadcreato...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Steve Bowden | Director of Information Technology

Boston Herald
Seaport Center | 70 Fargo Street | Suite 600
Boston, MA 02210


Muffin

unread,
Nov 14, 2014, 7:51:27 AM11/14/14
to multiad...@googlegroups.com
Thanks Steve for your input. I didn't know you could use AppleScript with Graphic Converter. I never wrote a script, but can't you use AppleScript in Creator to do the same thing. What value would Graphic Converter add? And since I never wrote a script, it would be great if there was a company I could hire to write a small program for me to automate the process. I use to know a developer that would do work like this but lost the information.

Rick Gaskin

unread,
Nov 14, 2014, 8:07:52 AM11/14/14
to multiad...@googlegroups.com
I had to do something similar once.

If I recall correctly it involved use Adobe Distiller and a watch folder function

You would export out of creator as an EPS into a distiller IN folder. Distiller would be set up to create a PDF and into an OUT folder

The OUT folder would be "watched" by a script that would upload/move the resulting PDF to its final destination (ie select path/volume)

again if i recall correctly (sorry)...you can set the distiller IN folder to delete the original EPS or not. If that is correct you could write a script to watch the IN folder with a delay..allowing for enough time for distiller to make a PDF and then upload/move the EPS to another select destination.

I am sorry if this sounds confusing. Unfortunately i do not have the scripts. Try searching the archives for my name...Steve Mills helped me write the scripts but he is no longer with the company. I will keep searching but at this point it doesn't look like I have them in my possession.

Rick Gaskin

Steve Bowden

unread,
Nov 14, 2014, 8:12:30 AM11/14/14
to multiad...@googlegroups.com
Yes you can script multi ad, there just isn't many people doing apple script any more. I don't write scripts either, i have cobbled them together before. With Converter, a series of hot folders and Automator (every mac has automator) you can change formats and move your files around. Automator is basically a GUI for applescript.

Steve Bowden

unread,
Nov 14, 2014, 8:13:16 AM11/14/14
to multiad...@googlegroups.com
Automator can be used to move and copy files in and out of watched folders

Rick Gaskin

unread,
Nov 14, 2014, 8:14:44 AM11/14/14
to multiad...@googlegroups.com
OK here is a script that I created that might help you. It generates a PDF on SAVE to a select destination. The path is defined in the first line.

property PDFPath : "AD-GRAPHICS:PDF_Proofs:"

using terms from application "MultiAd Creator Pro"
    on «event AtchSavd» theDoc
        set question to display dialog "Send Proof?" buttons {"Yes", "No"} default button 2
        set answer to button returned of question
        if answer is equal to "Yes" then
            set fileName to name of theDoc
            set destFolder to PDFPath
           
           
            --Trim off .crtr extension if it has one:
            if fileName ends with ".crtr" then
                set sd to AppleScript's text item delimiters
                set AppleScript's text item delimiters to {"."}
                set fileName to (text items 1 thru -2 of fileName) as text
                set AppleScript's text item delimiters to sd
            end if
           
            tell application "MultiAd Creator Pro"
                «event DnotXPDF» «class cSpd» of theDoc with «class ˛n14», «class ˛DSz», «class BiEn» and «class ˛Enc» without «class ∏PAS», «class ∏CMa», «class ∏RMa», «class ∏CBa», «class ∏DNo», «class ∏PIn», «class ∏TBO» and «class ˛Pre» given «class kfil»:(destFolder & fileName & ".pdf"), «class ∏POr»:«constant POrEØUsr», «class ExMe»:«constant ◊Plä≈Com», «class ReLi»:300, «class ˛BWC»:«constant EnTEÉFlt», «class ˛CoC»:«constant EnTËÉJPG», «class XJqu»:80
            end tell
        end if
    end «event AtchSavd»
end using terms from

Rick Gaskin

unread,
Nov 14, 2014, 8:28:46 AM11/14/14
to multiad...@googlegroups.com
very sorry for the mess i sent previously lol. try the following. you must copy the text below and compile it in script editor and save. take the script and place it in Creator>MultiAd Creator Add-Ons>Attached Scripts.

The script works as follows. When you hit SAVE (as in your saving the doc youa re working on) it will generate a PDF to select destination..in my case it is mounted volume called AD-GRAPHICS with a folder named PDF_Proofs

see the first line below..you will define it on your end.








property PDFPath : "AD-GRAPHICS:PDF_Proofs:"

using terms from application "MultiAd Creator Pro"
    on saved theDoc

        set question to display dialog "Send Proof?" buttons {"Yes", "No"} default button 2
        set answer to button returned of question
        if answer is "Yes" then

            set fileName to name of theDoc
            set destFolder to PDFPath
           
           
            --Trim off .crtr extension if it has one:
            if fileName ends with ".crtr" then
                set sd to AppleScript's text item delimiters
                set AppleScript's text item delimiters to {"."}
                set fileName to (text items 1 thru -2 of fileName) as text
                set AppleScript's text item delimiters to sd
            end if
           
            tell application "MultiAd Creator Pro"
                export PDF current spread of theDoc saving in (destFolder & fileName & ".pdf") print order user order export method composite black and white compression use zip color image compression use JPEG quality 80 with embed no base 14 fonts, use doc size, binary encoding and compress text and line art without print as spreads, crop marks, registration marks, color bars, document notes, plate information, text blocks only and presentation mode given «class CSpa»:«constant OCSpCMYK», «class SIRz»:300
               
            end tell
        end if
    end saved

end using terms from

On 11/14/14, 7:51 AM, Muffin wrote:

Lorenz

unread,
Nov 14, 2014, 8:55:25 AM11/14/14
to multiad...@googlegroups.com
The script you are looking for quit working after mac 10.6. 
I got it to work again by borrowing code from other scripts. 

I got this script to do what we wanted it to do by using script editor to record my steps in creator, and replacing this part of the code with the code it just created  

START   SECTION OF CODE TO REPLACE

with timeout of 3600 seconds

export EPS spread spreadIndex of document 1 saving in (outFold & nam) resolution limiting 600 flatness limiting 3.0 font inclusion all fonts preview options no preview export method composite output color space CMYK scaling by 100.0 bleed amount 0.0 with binary encoding, level 2 PostScript, OPI omit EPS and include Type 1 fonts with custom encoding without bitmap OPI Comments, OPI omit bitmap and making more compatible gradients

end timeout

end if


END  SECTION OF CODE TO REPLACE


FULL SCRIPT BELOW

(*


2003/03/19 Written by Steve Mills. Improvements over original “Export Folder of C6 to EPS” scripts:

-Handles long folder/file names in OSX.

-Allows long EPS file names in OSX.

-Logs errors for missing graphics, missing fonts, and overflowed text, and doesn't force user interaction when these occur.

-Handles multiple spreads with panache.

-Output dir can be same as input dir (or any dir inside it) because it doesn't use buggy "list folder" scripting addition.


*)



global c6files



on run

--The open handler takes a list of folders, so make this a list by putting {} around it:

set theFold to {(choose folder with prompt "Choose a folder of Creator documents to export as EPS files.")}

open theFold

end run



on open folds

--Declare local vars so Script Debugger will display them while debugging:

local folds, num, i, outFold, nam, ext, missingGraphics, missingFonts, overflowedText, spreadAction, spreadIndex, numSpreads, osVersion

--Test OS version for file name max len:

tell application "Finder"

set osVersion to version

set sd to AppleScript's text item delimiters

set AppleScript's text item delimiters to {"."}

set osVersion to every text item of osVersion

set AppleScript's text item delimiters to sd

set osVersion to (item 1 of osVersion) as number

end tell

set outFold to (choose folder with prompt "Where should the EPS files be exported to?") as string

--What should be done with documents that have multiple spreads?

set spreadAction to button returned of (display dialog "What should happen if a document has more than one spread?" buttons {"Ask User", "Export First Spread", "Export Last Spread"} default button "Export Last Spread")

set c6files to {}

set missingGraphics to {}

set missingFonts to {}

set overflowedText to {}

set num to number of items of folds

--Gather all the C6 files:

repeat with i from 1 to num

my GatherC6(item i of folds)

end repeat

--Turn goofy Finder file objects into alii:

set num to number of items of c6files

set alii to {}

repeat with i from 1 to num

set alii to alii & ((item i of c6files) as alias)

end repeat

set c6files to alii

--Export all the docs as EPS:

tell application "MultiAd Creator Pro"

activate

set num to number of items of c6files

repeat with i from 1 to num

try

with timeout of 3600 seconds

open {item i of c6files} without interaction

end timeout

on error err number errnum

--Catch and ignore missing graphics, overflowed text, and missing fonts errors, but report all others:

if errnum = 20026 then

set missingGraphics to missingGraphics & ((item i of c6files) as string)

else if errnum = 20700 then

set overflowedText to overflowedText & ((item i of c6files) as string)

else if errnum = 20711 then

set missingFonts to missingFonts & ((item i of c6files) as string)

else

error "The following error occurred while opening document “" & ((item i of c6files) as string) & "”:" & return & err

end if

end try

--Check for multiple spreads:

set numSpreads to number of spreads of document 1

if numSpreads > 1 then

if spreadAction is "Ask User" then

set done to false

repeat while not done

set rep to (display dialog "Enter spread number to export (1 to " & numSpreads & "):" default answer "1" buttons {"Cancel", "Skip", "Export"} default button "Export")

if button returned of rep is "Export" then

set spreadIndex to (text returned of rep) as number

if spreadIndex ≥ 1 and spreadIndexnumSpreads then set done to true

else if button returned of rep is "Skip" then

set spreadIndex to 0

set done to true

end if

end repeat

else if spreadAction is "Export First Spread" then

set spreadIndex to 1

else

set spreadIndex to numSpreads

end if

else

set spreadIndex to 1

end if

if spreadIndex > 0 then --0 means skip it.

--Build name for EPS file by removing ".crtr" (if it exists), adding ".eps", and making sure the name does not excede

--OS9's 31-char limit:

set nam to (name of document 1)

if length of nam > 5 then

set ext to (characters -5 thru -1 of nam) as string

ignoring case

if ext is ".crtr" then

set nam to (characters 1 thru -6 of nam) as string

end if

end ignoring

end if

if osVersion < 10 and length of nam > 27 then

set nam to (characters 1 thru 27 of nam) as string

end if

set nam to nam & ".eps"

--Export it:

with timeout of 3600 seconds

export EPS spread spreadIndex of document 1 saving in (outFold & nam) resolution limiting 600 flatness limiting 3.0 font inclusion all fonts preview options no preview export method composite output color space CMYK scaling by 100.0 bleed amount 0.0 with binary encoding, level 2 PostScript, OPI omit EPS and include Type 1 fonts with custom encoding without bitmap OPI Comments, OPI omit bitmap and making more compatible gradients

end timeout

end if

close document 1 without saving

end repeat

end tell

--Report errors by writing them to a log file in the output folder:

if missingGraphics ≠ {} or missingFonts ≠ {} or overflowedText ≠ {} then

set errF to (outFold & "Error Log")

tell application "Finder"

if exists file errF then

delete file errF

end if

end tell

set rn to (open for access errF with write permission)

write "The following documents reported errors when they were opened:" & return & return to rn

if missingGraphics ≠ {} then

write "Missing Graphics:" & return & "-----------------" & return to rn

my WriteErrList(missingGraphics, rn)

end if

if missingFonts ≠ {} then

write "Missing Fonts:" & return & "--------------" & return to rn

my WriteErrList(missingFonts, rn)

end if

if overflowedText ≠ {} then

write "Overflowed Text:" & return & "----------------" & return to rn

my WriteErrList(overflowedText, rn)

end if

close access rn

end if

activate

beep

display dialog "All Creator documents have been exported to EPS." buttons {"OK"} default button 1 giving up after 60

end open



on GatherC6(fold)

local fold, folds, num, f, inf

tell application "Finder"

set c6files to c6files & (every file of folder fold whose file type is "Crtr")

set folds to (every folder of folder fold)

set num to number of items of folds

repeat with i from 1 to num

my GatherC6((item i of folds) as alias)

end repeat

end tell

end GatherC6



on WriteErrList(errs, errF)

set num to number of items of errs

repeat with i from 1 to num

write (item i of errs) & return to errF

end repeat

write return to errF

end WriteErrList

Lorenz

unread,
Nov 14, 2014, 9:00:18 AM11/14/14
to multiad...@googlegroups.com
One of my coworkers has a script the runs in terminal to move the pdf files to the servers if you are interested I will get you in contact with him
(a lot more reliable and uses less resources than automator)

On Thursday, November 13, 2014 3:45:29 PM UTC-6, Muffin wrote:

Muffin

unread,
Nov 14, 2014, 9:17:09 AM11/14/14
to multiad...@googlegroups.com
Wow, thanks for all the responses, information, and scripts. I really appreciate it. I will have to digest it all and see what kind of direction I want to go in. I forget about Automator. I find it interesting that when I checked it out real quick, there were two Creator scripts already there waiting for me to drag over. One was for exporting EPS files and one was for exporting PDF files. Anyways, I find it very interesting Steve Mills no longer works for the company. Thanks again for everyone's input. 

Steve Mills

unread,
Nov 14, 2014, 9:52:37 AM11/14/14
to Creator list list
On Nov 14, 2014, at 08:17:09, Muffin <jmeh...@matthewsintl.com> wrote:
>
> Wow, thanks for all the responses, information, and scripts. I really appreciate it. I will have to digest it all and see what kind of direction I want to go in. I forget about Automator. I find it interesting that when I checked it out real quick, there were two Creator scripts already there waiting for me to drag over. One was for exporting EPS files and one was for exporting PDF files. Anyways, I find it very interesting Steve Mills no longer works for the company. Thanks again for everyone's input.

But I still watch this mailing list. It's nice to be remembered. :) I didn't reply to your question because I don't have much spare time to help with this sort of thing. Yes, there are those 2 Automator actions for Creator that you might be able to use more easily than you could write a script. And you can also add AppleScript scripts to Automator workflows if you need to do other things. It all depends on how complex it needs to be. You mentioned exporting the pdf to one server and then the eps to another server. If the script needs to mount those servers, that adds complexity. If it needs to exit gracefully if the servers aren't mounted, that's more complexity.

--
Steve Mills
Drummer, Mac geek

Steve Mills

unread,
Nov 14, 2014, 9:55:53 AM11/14/14
to Creator list list
On Nov 14, 2014, at 07:55:25, Lorenz <lorenz....@gmail.com> wrote:
>
> The script you are looking for quit working after mac 10.6.

In what way did it quit working after 10.6? I was still with MultiAd when 10.6 was released, so I would've been there to fix it if it was reported as broken. Do you mean 10.6 broke it or 10.7 broke it?

Muffin

unread,
Nov 14, 2014, 10:17:56 AM11/14/14
to multiad...@googlegroups.com
Great to hear from you Steve! And the servers will already be mounted. I just have to direct it to a specific folder on the server. Hopefully, its just a matter of specifying the path.

Lorenz

unread,
Nov 14, 2014, 10:27:21 AM11/14/14
to multiad...@googlegroups.com
worked in 10.6    stopped working in 10.7 (at least for us, we may have modified it some)


On Thursday, November 13, 2014 3:45:29 PM UTC-6, Muffin wrote:

Steve Mills

unread,
Nov 14, 2014, 10:28:42 AM11/14/14
to Creator list list
On Nov 14, 2014, at 09:17:56, Muffin <jmeh...@matthewsintl.com> wrote:
>
> Great to hear from you Steve! And the servers will already be mounted. I just have to direct it to a specific folder on the server. Hopefully, its just a matter of specifying the path.

Sounds good. If you run into road blocks with Automator and would rather have a scripted solution, I'll do what I can to help out.

Muffin

unread,
Nov 14, 2014, 10:34:43 AM11/14/14
to multiad...@googlegroups.com
Appreciate Steve. I will keep you on the back burner. 

Steve Mills

unread,
Nov 14, 2014, 11:18:11 AM11/14/14
to multiad...@googlegroups.com
On Nov 14, 2014, at 09:34, Muffin <jmeh...@matthewsintl.com> wrote:
>
> Appreciate Steve. I will keep you on the back burner.

Don't let me boil over.

Steve via iPad

Muffin

unread,
Nov 14, 2014, 11:38:16 AM11/14/14
to multiad...@googlegroups.com
LOL!

Muffin

unread,
Nov 17, 2014, 8:37:08 AM11/17/14
to multiad...@googlegroups.com
Hi Lorenz,

I was thinking, I just might need the terminal script for moving formats to the server. So if you could, have your co-worker send me the terminal script he used and maybe I can figure out how to plug my server into there, replacing his server. No rush on this though. Whenever you get a chance. I appreciate it very much.


On Friday, November 14, 2014 9:00:18 AM UTC-5, Lorenz wrote:

Steve Mills

unread,
Nov 18, 2014, 1:55:48 PM11/18/14
to Creator list list
On Nov 14, 2014, at 07:55:25, Lorenz <lorenz....@gmail.com> wrote:
>
> The script you are looking for quit working after mac 10.6.
> I got it to work again by borrowing code from other scripts.

Do you mean the script applet named "Batch Export EPS 2.0.app" quit working? It was saved as PowerPC only, so it's no wonder. Anyone can open it with Script Editor and resave it.

More Sugar

unread,
Nov 27, 2014, 8:42:51 PM11/27/14
to multiad...@googlegroups.com

Totally unrelated but I just wanted to say "Hi" to Steve (didn't know you had moved on, either, but glad you are still on the list!) and everyone, and wish you all a Happy Turkey Day! I'm not on much these days, either. Working only P/T at More Sugar now, and have a full-time design job in the marketing department of an awesome local gym. I still scan the emails from time to time when I'm in the office.

Cheers everyone! Karen

> --
> --
> You received this message because you are subscribed to the "MultiAd
> Creator User Group" group.
> To post to this group, send email to multiad...@googlegroups.com
> To unsubscribe from this group, send email to
> multiadcreato...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/multiadcreator?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "MultiAd Creator User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to multiadcreato...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


--

More Sugar Entertainment
www.moresugar.com | facebook.com/moresugarmag
Tom office: 845-526-2190 | Tom cell: 845-729-2511

Steve Mills

unread,
Nov 30, 2014, 1:52:19 AM11/30/14
to Creator list list
On Nov 27, 2014, at 19:42:50, More Sugar <mors...@bestweb.net> wrote:
>
> Totally unrelated but I just wanted to say "Hi" to Steve (didn't know you had moved on, either, but glad you are still on the list!) and everyone, and wish you all a Happy Turkey Day! I'm not on much these days, either. Working only P/T at More Sugar now, and have a full-time design job in the marketing department of an awesome local gym. I still scan the emails from time to time when I'm in the office.

Hi Karen! More Sugar! :) Yeah, we (the Minnesota developers for Creator) have been gone for over 3 years now.

barb

unread,
Dec 9, 2014, 6:58:00 PM12/9/14
to multiad...@googlegroups.com
I wanted to respond sooner but I have not been on my computer in a few weeks due to a family emergency. I also would like to say hi to Steve. I had no idea that you were no longer with Multi-Ad and no longer working on Creator. And for so long now too! I hope that you are doing well in whatever your new endeavor is. And I do want to say “thank you” for all you did for us users and how much you listened to our requests and concerns. Your “customer service” was always awesome!

barb

unread,
Dec 9, 2014, 7:06:58 PM12/9/14
to multiad...@googlegroups.com
Is anyone using a Mac and using a Belkin wireless numeric keypad with Creator and having problems? I finally ditched my wired extended keyboard. Only reason I wasn’t using a wireless is that I use my numeric keyboard all the time and Apple doesn’t make it wireless. I found that Belkin makes one that matches the Apple wireless, so I bought both. The problem is that Creator does not recognize most of the numbers on the Belkin. I can only type the numbers 2, 4, and 6 with it. Any other number is as if I never even pressed a key. I have no problem with it in any other program. I freaked out when I couldn’t use my usual keyboard shortcuts for aligning objects, but luckily got around it by setting them all up in Keyboard Maestro. I was wondering if there is some known issue with this and how to fix it.

Steve Mills

unread,
Dec 9, 2014, 11:41:05 PM12/9/14
to Creator list list
On Dec 9, 2014, at 17:57:59, barb <barb...@optonline.net> wrote:
>
> I wanted to respond sooner but I have not been on my computer in a few weeks due to a family emergency. I also would like to say hi to Steve. I had no idea that you were no longer with Multi-Ad and no longer working on Creator. And for so long now too! I hope that you are doing well in whatever your new endeavor is. And I do want to say “thank you” for all you did for us users and how much you listened to our requests and concerns. Your “customer service” was always awesome!

Thanks Barb! It's rare for a developer (other than a small shareware type author) to have the opportunity to work that closely with customers, and I think it made for a much better product and experience all around. I miss doing that and all the AppleScript projects I did for y'all.

Steve Mills

unread,
Dec 9, 2014, 11:53:15 PM12/9/14
to Creator list list
On Dec 9, 2014, at 18:06:57, barb <barb...@optonline.net> wrote:
>
> Is anyone using a Mac and using a Belkin wireless numeric keypad with Creator and having problems? I finally ditched my wired extended keyboard. Only reason I wasn’t using a wireless is that I use my numeric keyboard all the time and Apple doesn’t make it wireless. I found that Belkin makes one that matches the Apple wireless, so I bought both. The problem is that Creator does not recognize most of the numbers on the Belkin. I can only type the numbers 2, 4, and 6 with it. Any other number is as if I never even pressed a key. I have no problem with it in any other program. I freaked out when I couldn’t use my usual keyboard shortcuts for aligning objects, but luckily got around it by setting them all up in Keyboard Maestro. I was wondering if there is some known issue with this and how to fix it.

That's pretty strange. I'm guessing Belkin didn't use all the correct values for their key numbers or something like that. If you choose Creator->Key Equivalents and open the Hidden Key Equivs item, does it show the correct key equivs for the various alignment menu items? What if you change them in that dialog? Can you change them to command-numpad key equivs, and if so, do they show up with the right key equivs in there?

barb

unread,
Dec 10, 2014, 1:06:34 AM12/10/14
to multiad...@googlegroups.com
I just looked and all the key equivs are listed. So I tried changing one. I can only use the numbers 2, 4, and 6 so I tried changing one of the key equivs to "Command numeric keypad 2". When I did only the numeric keypad number 2 shows up in the field but not the command sign, so it immediately tells me it needs a modifier key, but it won’t recognize that I typed it. The interesting thing is that if I type "Command 2" using the number 2 key on the regular keyboard then the Command key shows up with the regular number 2. Weird. Every other program has no issues with the numeric keypad. All numbers type fine. It’s just Creator that is having an issue with it.

barb

unread,
Dec 10, 2014, 1:08:40 AM12/10/14
to multiad...@googlegroups.com
It absolutely did make for a better product and user experience. I owe many of Creator’s great features to you!

More Sugar

unread,
Dec 28, 2014, 11:29:25 PM12/28/14
to multiad...@googlegroups.com

Hear, hear! Agreed. And happy new year everyone!

Karen

Muffin

unread,
Jan 14, 2015, 1:33:22 PM1/14/15
to multiad...@googlegroups.com
Hi Steve, I don't get it. I tried to use Automator with the existing Creator actions by simply choosing the Folder Action route. I told automator what folder and I saved it. When I drag a PDF into that folder, nothing happens. What am I missing?

Steve Mills

unread,
Jan 14, 2015, 2:21:48 PM1/14/15
to Creator list list
On Jan 14, 2015, at 12:33:22, Muffin <jmeh...@matthewsintl.com> wrote:
>
> Hi Steve, I don't get it. I tried to use Automator with the existing Creator actions by simply choosing the Folder Action route. I told automator what folder and I saved it. When I drag a PDF into that folder, nothing happens. What am I missing?

It appears that a change was made in Creator at some point, but not reflected in the Automator actions. The action gets an error. I see no way that you could fix the action. Sorry. But you could choose to *not* use the Creator-supplied actions and just use an AppleScript action in its place. It's not as convenient, but it would get the job done.

Muffin

unread,
Mar 18, 2015, 3:41:22 PM3/18/15
to multiad...@googlegroups.com
Steve,

I need to borrow your expertise to do some scripting for me since I do not have time to learn which I was planning to, but has not worked out. I have code someone gave me here which is basically what I want to accomplish but I need it revamped to work for my situation. I can pay you if you do the freelance sort of thing. 

I would like to have a hot folder on the users desktop scanned for EPS and PDF files. When it finds them, it moves the EPS files to one directory and the PDF files to another directory. And deletes the files out of the hot folder after they are moved. I need a script that will automatically run on any users desktop, and sense when files are placed in the hot folder. Not sure how to go about this.

Here is the script I acquired:

<?php 

/*
*This script scans a directory for EPS and PDF files. 
*It moves EPS files to one directory and PDF files to another.
*All other files are left alone.
*/

//Set Directories
//Set 2 arrays to be used later
$file_location = "/Volumes/Macintosh HD/Users/darinwatts/Desktop/DesktopFolder"; //Move From Directory.
$MoveToEPS = "/Volumes/SPECIAL JOBS2/NOT GARY/MoveToEPS"; //Move To EPS Directory.
$MoveToPdfs = "/Volumes/SPECIAL JOBS2/NOT GARY/MoveToPDF"; //Move To PDF Directory.
$file_array1 = array();
$file_array2 = array();

//Scan The Directory $file_location For Files And Remove . and .. Files.
If (is_dir($MoveToEPS)) {  //Make sure $MoveToEPS is a valid directory.
If (is_dir($MoveToPdfs)) {  //Make sure $MoveToPDF is a valid directory.
If (is_dir($file_location)) { //Make sure $file_location is valid directory.
$file_array1 = scandir($file_location); //Create Array of Files In Directory.
$omit0 = array_search(".", $file_array1); //Search For . File.
unset($file_array1[$omit0]); //Unset Value For . File.
$omit1 = array_search("..", $file_array1); //Search For .. File.
unset($file_array1[$omit1]); //Unset Value For .. File.
$omit2 = array_search(".DS_Store", $file_array1); //Search For .DS_Store File.
unset($file_array1[$omit2]); //Unset Value For .DS_Store File.
$file_array2 = array_values($file_array1); //Reassign array values to new array.
}
else {
die ("Invalid Directory. DesktopFolder is an invalid directory.\n"); //Quit if $file_location is an invalid directory.
}}
else {
die ("Invalid Directory. SPECIAL JOBS2 is not mounted.\n"); //Quit if $MoveToPDFs is an invalid directory.
}}
else {
die ("Invalid Directory. SPECIAL JOBS2 is not mounted.\n"); //Quit if $MoveToEPS is an invalid directory.
}
foreach ($file_array2 as $value) {     //Determine if File is PDF or EPS
list ($filename, $filetype) = explode('.', $value);
if (strtolower($filetype == "eps")) {     //Determine if File is EPS
copy($file_location . "/" . $value, $MoveToEPS . "/" . $value);
unlink($file_location . "/" . $value);
}//end if
else if (strtolower($filetype == "pdf")) {    //Determine if File is PDF
copy($file_location . "/" . $value, $MoveToPdfs . "/" . $value);
unlink($file_location . "/" . $value);
}//end else if
}//foreach
?>

Steve Mills

unread,
Mar 20, 2015, 12:34:16 AM3/20/15
to Creator list list
On Mar 18, 2015, at 14:41:22, Muffin <jmeh...@matthewsintl.com> wrote:

> I need to borrow your expertise to do some scripting for me since I do not have time to learn which I was planning to, but has not worked out. I have code someone gave me here which is basically what I want to accomplish but I need it revamped to work for my situation. I can pay you if you do the freelance sort of thing.
>
> I would like to have a hot folder on the users desktop scanned for EPS and PDF files. When it finds them, it moves the EPS files to one directory and the PDF files to another directory. And deletes the files out of the hot folder after they are moved. I need a script that will automatically run on any users desktop, and sense when files are placed in the hot folder. Not sure how to go about this.

This is pretty easy. It could use Folder Actions, which is a function built into OS X. You tell a folder to use a script to handle actions done to that folder. The script can run when files are added to the folder. It will be given the newly added files and can do stuff to them, like move them to other folders. I was able to write the basic script in about 10 minutes.

I forget if this version of the list allows attachments. I'll try attaching it. If it fails, email me directly.

It takes a few steps to set up:

1. Unzip the script and put it into one of two places:
If you want any user to use it: "/Library/Scripts/Folder Action Scripts"
If you want a single user to use it: "/Users/<username>/Library/Scripts/Folder Action Scripts"

2. Edit that script and change the paths for your eps and pdf folders. There's a big comment that says "NOTICE!!!!" to mark where you need to do this.

3. If you have your system-wide AppleScript menu turned on (most users don't), choose Folder Actions->"Attach Script to Folder".
3b. If you don't have the script menu showing, navigate to "/Library/Scripts/Folder Actions" and open the script named "Attach Script to Folder.scpt".

4. Step 3 will present a dialog where you can choose the script from step 1. Select it and hit OK.

5. It will then ask you to choose the folder to attach that script to. Choose your hot folder.

That's it. Any eps or pdf files dropped into that folder will be moved to the appropriate folder.
add - move eps and pdf.scpt.zip
Reply all
Reply to author
Forward
0 new messages