Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts

Tuesday, September 2, 2014

Applescript to save InDesign pages as outlined EPS files

Today I wrote an Applescript that saves InDesign pages as EPS files, with text converted to outlines. It's kind of sad that I have to do this, but unfortunately that's where we are at this point. Anyway, I thought somebody might find this useful.

To use it, open up Applescript Editor and save as an application.

If you double-click on the application it will take the current InDesign document and:

  1. create a new subfolder inside the folder where the InDesign document is, called “PRINT”
  2. save the InDesign document as a “High Quality Print” PDF in that folder
  3. Open each page of the PDF in Illustrator, in turn, and then save it as an outlined EPS, in the same subfolder.

If you drag one or more closed InDesign files to the application icon, it will open each file in InDesign, do the above steps, and then close the document.

Here's the script...


on SaveAsEPS(indd)
    
    set thePrintDirName to "PRINT"
    
    tell application id "com.adobe.InDesign"
        set inddFolder to file path of indd
        set inddName to name of indd
    end tell
    
    -- the following sets basename to be the InDesign filename 
    -- without the .indd extension
    
    set AppleScript's text item delimiters to "."
    set TextItms to text items of inddName
    set LastItem to item -1 of TextItms
    if LastItem = "indd" then
        set TextItms to reverse of rest of reverse of TextItms
    end if
    set basename to (TextItms as string)
    set AppleScript's text item delimiters to ""
    
    -- make a PRINT folder underneath the InDesign file's folder
    tell application "Finder"
        if (exists folder thePrintDirName of folder inddFolder) is false then
            make folder at inddFolder with properties {name:thePrintDirName}
        end if
    end tell
    
    
    tell application id "com.adobe.InDesign"
        
        set theFileName to (inddFolder & thePrintDirName & ":" & basename) ¬
                    as string
        set thePDFName to (theFileName & ".pdf") as string
        
        tell PDF export preferences
            set page range to all pages
        end tell
        
        tell indd
            export format PDF type to thePDFName without showing options
        end tell
        
        set pageCount to count of pages of indd
        
        tell application "Adobe Illustrator"
            
            repeat with thePageNum from 1 to pageCount
                
                set user interaction level to never interact
                set page of PDF file options of settings to thePageNum
                open (thePDFName as alias) without dialogs
                
                set theEPSName to ¬
                     (theFileName & "_" & thePageNum & "_outl.eps") as string
                
                convert to paths text frames of current document
                save current document in (theEPSName) as eps ¬
                      with options {CMYK PostScript:true, ¬
                      embed all fonts:true, preview:color TIFF, ¬
                      compatibility:Illustrator 8}
                close current document saving no
                
            end repeat
            
        end tell
        
        beep
        display alert "Done exporting." giving up after 10
    end tell
    
end SaveAsEPS

on run {}
    
    tell application id "com.adobe.InDesign"
        
        set theInDD to active document
        tell me to SaveAsEPS(theInDD)
        
    end tell
    
end run

on open Lst
    
    tell application id "com.adobe.InDesign"
        repeat with zItm in Lst
            set Itm to zItm as alias
            set theInDD to open Itm
            
            tell me to SaveAsEPS(theInDD)
            
            close theInDD saving no
            
        end repeat
    end tell
    
end open




Good luck. Some of this was inspired by code on macgrunt.

Friday, August 1, 2014

Xcode kept asking for license agreement

This may be incredibly specific and boring for most people, but: It turns out that if somehow your /Library/Preferences folder isn't world-readable, Xcode will ask you for license approval every single time you start it (or you run any of the command-line development utilities).

I thought somebody out there besides me, searching the web, might want to know that. I don't know how the permissions of my /Library/Preferences folder changed, but it did somehow.

Thursday, December 21, 2006

Adobe's icon scheme

This seems to be the general reaction of users to Adobe's new icon scheme:

Fu

Sunday, July 24, 2005

MacDesktops.com

This is old news for lots of people, but I've been downloading background pictures ("wallpaper") lately from MacDesktops.com. I don't really know why the guy calls it MacDesktops, as the images should be perfectly usable on any operating system. There are a number of images of Macs and Apple-related things, but for me the landscapes and waterscapes are much more pleasant to look at. Images are in a wide variety of resolutions -- I haven't seen other sites where the images are not only in the standard 4:3 ratio but are also in widescreen resolutions like 1920x1200 and 1680x1250.

Anyway, I like the pictures and sent the guy $20, since I've used a lot of his bandwidth downloading them. Check it out.

Monday, June 13, 2005

Web pages should not steal focus

Here's what happens to me today:

1) Go to page full of links. Open two of them in separate tabs.

2) Click on first tab.

3) Read page in first tab.

4) Click on link to newspaper story from first tab.

5) Before newspaper story loads, click on second tab.

6) Read headline in second tab and realize you don't want to read the whole thing.

7) Hit command-W to close tab.

That all works fine, except that I didn't know about step 6a)

6a) Newspaper story loads in first tab, and demands focus, so first tab magically comes to the front.

Which means, of course, that my command-W ended up closing the first tab and not the second one.

Argh. Whoever invented the thing that allows web pages to say "me! I'm supposed to be the top window! me! me!" should be forced to program nothing but embedded processors for thermostats the rest of his/her life. The "blink" tag had nothing on this.

Sunday, June 12, 2005

Open source implementation of Mac OS X APIs

I wonder if someday there will be an open-source implementation of the Mac OS X APIs (other than GNUstep).

I hope that if so, it will be called "Cider."

Saturday, May 21, 2005

Firewire! Give my creation firewire!

I had a minor success today. A few weeks ago I accidentally closed the outer case of my old dual firewire enclosure on the power wire. This unfortunately blew the power supply. I couldn't figure out how to open the damn thing to see if the fuse could be replaced, so I just ended up buying a dual SCSI case listed on Craigslist. It's a a CI Design 3520 2 bay 3.5" drive enclosure. (I can't find a company that lists the price in dollars, but apparently a company in England wants £145 for it. Pretty good for $10.)

This case unfortunately doesn't have holes in the normal locations to fit other drives; it uses some kind of weird drive rails, or something, that fit little tabs in the side of this case. (you can see these in the brochure).

I'd like to say that I made the decision to just drill holes in the side of the rail assembly after searching the web and finding out the difficulty of buying these rails -- none of CI Design's listed retailers seem to carry the kit -- but in fact I found the manufacturer label only after buying the rather longer than usual screws, drilling the holes, and installing the drives. Oh well. The point is, the thing works. Yay! And I didn't have to use lighting from my castle to reanimate it. I did have to install the drives upside down, but I remember reading that this is usually OK (and Seagate's manuals specifically say "any orientation" so I'm going to take their word for it).

I now have two 120 GB drives in it, one Maxtor and one Seagate. The bridgeboard from my old case is an ATA-5 bridgeboard with the 137 GB limitation, so this pretty much maxes out the capacity. (They don't actually make 137 GB drives, for some reason; you can either use 120 GB drives or waste space using 160 GB drives. I here use 1GB = 1 billion bytes, not 230 bytes.)

I thought this was such a good idea that I bought a bridgeboard and dual 5.25" case from eBay -- I'm going to put a 160 GB hard drive and a DVD-RW drive in it and give it to my brother and his family for their iMac. I hope the case gets here soon.

The only problem is the thing sounds like a wind tunnel. I haven't decided whether to replace the fan, but I'm thinking about it. This case is quite big and there's plenty of space between the drives, so I suspect maybe it doesn't need a fan at all, but I'm not sure I want to take chances, even though this is intended to be used just for backups and occasional use when I need a lot of scratch space.

Thursday, December 23, 2004

Answering machines

They call them answering machines, but they don't usually sound
like this (332K MP3).

Tuesday, December 31, 2002

% finger aaron

Remember finger? Ah, the old days of the Internet. "finger user@domain" was a little like a personal home page, before the World Wide Web was invented. This is what you would get if you fingered me, if any of the machines I used ran a finger daemon these days (which they don't). Although now that Mac OS X is Unix, you can finger me if you're logged onto my Mac.

Sometimes I miss the Internet the way it was in 1988-1993, before "the eternal September." When I first worked for ClariNet I had to explain what the Internet was to my grandmother. Five years later she sent me an email. I guess that's a good thing overall, but still, I miss the days when the Internet was a new way of allowing people to access information they were never able to access before, rather than a new way of trying to exploit venture capitalists with more money than they know what to do with.

I used to like the idea of "Internet years" (like dog years, only one real year equals twelve Internet years) until I realized it made me 144 years old. (Even more by now, of course.)

On the other hand, I've always had a deeply ambivalent attitude towards fascination with computers and other technological interests. I never really fit into the crowd on that. (My "geek code block" perhaps embodies this ambivalence.)

I don't know why this introduction is longer than the "finger" results it introduces.


Login: aaron             Name: Aaron Priven
Directory: /Users/aaron              Shell: /bin/tcsh
On since Tue Dec 17 12:40 (PST) on console, idle 7:04 (messages off)
On since Tue Dec 17 18:20 (PST) on ttyp1
Plan:
Sure, I have a .plan, but do I have an .environmental-impact-report
and an .alternatives-analysis?

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
G! !G
------END GEEK CODE BLOCK------