2017-10-06 21 views
0

私はこの問題を抱えています。
私の文書では、すべてのテキストボックスをスキャンして特定の最初の文字を特定の適用フォントと適用サイズ(等)で検索したいと考えています
見つけたら、別の文書
私は特定の最初の文字の別のタイプを検索し、見つからない場合は...
私はそれを見つけた場合、私が見つからない場合は、別の文書
内のテキスト項目のそれ過去のストーリー全体をコピーし、検索別のタイプの特定の最初の手紙...
もし私がそれを見つけたら、テキスト項目の全話をコピーして別の文書の中に入れてください。最初の文字の適用フォントとサイズで「ストーリー」を選択

私のdoc

tell application (CS6) 
-- bla bla bla 
if applied font of character 1 of characters of texts of object reference of text frame 1 of text frames is ("Taz" & tab & "Regular") then 

または

tell application (CS6) 
set Titoli to {applied font:"Taz", point size:{15, 16, 17, 18, 19, 20}} 
-- bla bla bla 
if applied font of character 1 of characters of texts of object reference of text frame 1 of text frames is in Titoli then ... 

が、それはうまくいきませんでした... :-(

私のAppleScriptのknowledgementのLページには、申し訳ありません...私の悪い英語よりも悪化しています。

tell application "Adobe InDesign CS6" 
-- VERIFICA E DEFINIZIONE DOCUMENTO 
try 
    set Tedesco to active document 
on error 
    display dialog "Nessun documento aperto." buttons {"Annulla"} default button "Annulla" with icon 0 
end try 
set Titoli to {applied font:"Taz", point size:{15, 16, 17, 18, 19, 20}} 
set Testo to {applied font:"Taz", fill color:"Black", point size:8} 
set Didascalie to {applied font:"TazCd", fill color:"Black", point size:7.5} -- dev'essere "da 5 a 7.5" 
set Sottotitoli to {applied font:"Taz" & tab & "Semibold", fill color:"White", point size:14} 
tell Tedesco 
    set PagineTotali to count pages of Tedesco 
    repeat with PaginaCorrente from 1 to PagineTotali -- ripeti per tutte le pagine del documento 
     set locked of every text frame to false -- sblocca tutti i box di testo 
     set allTextBoxes to text frames of page (PaginaCorrente) -- seleziona tutti i box di testo della pagina 
     repeat with textboxnum from 1 to count allTextBoxes 
      set currentTextBox to item textboxnum of allTextBoxes 
      set myTextFrame to currentTextBox -- definisce myTextFrame il testo contenuto nel frame 1 della mia pagina 
      tell parent story of myTextFrame -- chiama tutto il contenuto di myTextFrame 
       set PrimoCarattere to object reference of text from character 1 to character 1 of paragraph 1 -- seleziona solo il primo paragrafo 
       tell PrimoCarattere -- chiama il testo selezionato 
        -- if label of properties of myTextFrame is not equal to "GoToTheNext" 
        if properties of every character of every text of ParagrafoUno is in Didascalie then 
         display dialog ("Didascalia") 
         set label of properties of myTextFrame to "GoToTheNext" 
        end if 
       end tell 
       -- set stileparagrafo to name of applied paragraph style of TestoTrovato -- definisce "stileparagrafo" il nome dello stile di paragrafo applicato al testo trovato 
       -- set stilecarattere to name of applied character style of TestoTrovato -- definisce "stilecarattere" il nome dello stile di carattere applicato al testo trovato 
       -- set corpo to point size of TestoTrovato -- definisce "corpo" la grandezza del corpo espressa in punti applicata al testo trovato 
      end tell 
     end repeat 
    end repeat 
end tell 
end tell 

答えて

0

すべての提案を事前に感謝し、テキストボックスをループする必要はありません:ドキュメント内の話を通して、あなたがすることができ、単純にループが。

残念ながら、AppleScriptでは自分のスキルがここにnilのですが、JavaScriptでそれを行う方法をされています

var myDocument = app.activeDocument; 

for(myCounter = 0; myCounter < myDocument.stories.length; myCounter++){ 
    if(myDocument.stories.item(myCounter).characters.item(0).appliedFont.fontFamily=='Arial' && myDocument.stories.item(myCounter).characters.item(0).appliedFont.fontStyleName == 'Regular'){ 
     //copy paste the story here 
     var newDoc = app.documents.add(); 
     var newTextFrame = newDoc.pages.item(0).textFrames.add(); 
     newTextFrame.geometricBounds = [1, 1, 5, 5]; 

     myCopy =myDocument.stories.item(myCounter).texts[0].duplicate(LocationOptions.AFTER,newTextFrame.insertionPoints[0]) 
     } 
} 

うまくいけば、正しい道

にあなたを置くことができます
関連する問題