🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19823

Re: Font Type Variable

#19823
From: Shane Stanley
Date: Sat, 16 Nov 2002 21:09
33 lines
1937 bytes
in article 1de6a01a.-1@WebX.la2eafNXanI, rob day wrote:

> When I run the script from Script Editor I get what I want:
> 
> Eboy EXTGamma type 1 yes
> ITC Officina Sans Bold type 1 yes
> ITC Officina Sans Book type 1 yes
> Times Regular TrueType yes
> 
> If I run it any other way-- as an app or from Quickeys or the script menu, the
> font type is returned incorrectly:
> 
> Eboy EXTGamma ?constant ****ftT1? yes
> ITC Officina Sans Bold ?constant ****ftT1? yes
> ITC Officina Sans Book ?constant ****ftT1? yes
> Times Regular ?constant ****ftTT? yes
> 
> Anyway to fix this?

This is an artifact of the way AppleScript works. The enumerations like
"type 1" aren't actually saved in the script; the stuff you are seeing is
the actual code that gets saved, and these are only turned back into
enumerations when you open the script in a script editor.

The workaround is is a series of if statements that give you a string rather
than an enumeration:

if fontType = type 1 then
 set fontType to "type 1"
else if fontType = ...

-- 
Shane Stanley,  sstanley@myriad-com.com.au
Technical Details
Message-ID: <B9FCFF2A.43F5C%sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-04!supernews.com!newsswitch.lcs.mit.edu!newsfeed.cwix.com!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de6a01a.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,e17c95f60e79f178
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-11-16 13:46:02 PST
From: Shane Stanley <sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-04!supernews.com!newsswitch.lcs.mit.edu!newsfeed.cwix.com!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Font Type Variable
Message-ID: <B9FCFF2A.43F5C%sstanley@myriad-com.com.au>
Date: Sat, 16 Nov 2002 13:09:15 -0800
References: <1de6a01a.-1@WebX.la2eafNXanI>
Lines: 37
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.6
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit