Skip navigation
This discussion is archived

AppleWorks drawings to Pages.

15459 Views 66 Replies Latest reply: May 3, 2009 6:07 AM by lbrookins RSS
  • Level 8 Level 8 (41,760 points)
    Currently Being Moderated
    Apr 22, 2009 3:19 AM (in response to KOENIG Yvan)
    (1) it seems that it's time to buy a new keyboard. Mine is eating too many strokes

    (2) Here is the enhanced script:



    on run
    local cheminsourceGR, enTexte, measures, beg, isLandscape, mG, mH, mD, mB, ww, hh, measures2, prem, doc_width, doc_height, results
    set cheminsourceGR to (choose file with prompt "Choose an AppleWorks Draw document…" of type {"com.apple.appleworks.cwk"}) as text

    set enTexte to read file cheminsourceGR from 1 for 4096
    set measures to {}
    set beg to 27
    repeat with i from beg to (beg + 24 - 1) by 2
    copy ((ASCII number of character i of enTexte) * 256) + (ASCII number of character (i + 1) of enTexte) to end of measures
    end repeat

    tell measures
    set isLandscape to (item 3 < item 4)
    set {mH, mG, mB, mD} to {item 5, item 6, item 7, item 8}
    set page_Width to (item 4) - mG - mD
    set page_Height to (item 3) - mH - mB
    end tell -- measures

    set prem to count of item 1 of my decoupe(enTexte, "LOM!")

    if isLandscape then
    set {beg, ww, hh} to {prem + 702, 3, 1}
    else
    set {beg, ww, hh} to {prem + 364, 1, 3}
    end if
    set measures2 to {}
    repeat with i from beg to beg + 4 by 2
    copy ((ASCII number of character i of enTexte) * 256) + (ASCII number of character (i + 1) of enTexte) to end of measures2
    end repeat
    tell measures2
    set doc_width to item ww
    set doc_height to item hh
    end tell
    set nbPagesWidth to doc_width div page_Width
    set nbPagesHeight to doc_height div page_Height

    set results to "isLandscape : " & isLandscape & return & "measures : " & my recolle(measures, ", ") & return & "page_Width : " & page_Width & return & "page_Height : " & page_Height & return & "measures2 : " & my recolle(measures2, ", ") & return & "doc_width : " & doc_width & return & "doc_height : " & doc_height & return & "nbPagesWidth : " & nbPagesWidth & return & "nbPagesHeight : " & nbPagesHeight
    set the clipboard to results
    display alert results
    end run

    --=====

    on decoupe(t, d)
    local l
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to ""
    return l
    end decoupe

    --=====

    on recolle(l, d)
    local t
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to ""
    return t
    end recolle

    --=====


    Yvan KOENIG (from FRANCE mercredi 22 avril 2009 12:19:17)
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !, Mac OS X (10.4.11)
  • Level 8 Level 8 (41,760 points)
    Currently Being Moderated
    Apr 22, 2009 12:15 PM (in response to Roger Wilmut1)
    It seems that you didn't read carefully my explanations.

    Merge in an AW WP document with the defined tabs.
    Save the WP
    Import it in Pages.
    This import process doesn't uses the normalized clipboard.
    It grabs every attributes.

    So with this scheme it would be useful to re-design the script.
    If you try do apply the process and get the wanted result, it will be time to try to build a script on this basis:

    select the range of records to transfer
    execute the merge task
    save the doc
    open it in Pages
    Select All
    Copy to the clipboard

    the result would be a clipboard with every attributes because it will be a "Pages private one".

    Thanks for the feedback about the code grabbing the document's size.

    I will insert the enhanced code in the scripts so, the extraneous blank pages will no longer exist.

    Yvan KOENIG (from FRANCE mercredi 22 avril 2009 21:13:44)
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !, Mac OS X (10.4.11)
  • Level 8 Level 8 (41,760 points)
    Currently Being Moderated
    Apr 23, 2009 5:30 AM (in response to Roger Wilmut1)
    I really don't understand.

    What I'm aiming for is to be able to eliminate AW altogether, replacing the database module with FileMaker Pro (I'm assuming that Filemaker can do anything the AW database will do) against the day that an upgrade of some sort stops AW from working.


    FileMaker, as well as AppleWorks is able to build reports and merged documents.
    As far as I know, the merge function apply in the program itself so it would not require any transfer from FileMaker to an other tool.

    Your datas are organized with carefully designed TABs in AppleWorks documents.
    My proposal was defined to transfer this organization in a Pages document.
    I thaught that the goal was to leave AppleWorks after transferring the datas.

    If you transfer the contents of the database in a Numbers document, you will be able to define a Pages document in which you will be able to merge with carefully designed TABs too.
    I already posted a script allowing us to merge several records in a single sheet.
    With this tool, the basic uses of the AW DB are reproduced in iWork.

    Yvan KOENIG (from FRANCE jeudi 23 avril 2009 14:30:11)
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !, Mac OS X (10.4.11)
  • Level 8 Level 8 (41,760 points)
    Currently Being Moderated
    Apr 23, 2009 12:47 PM (in response to Roger Wilmut1)
    May you read carefully ?

    I wrote that I would pass the document from Numbers to Pages thru the merge process, not thru the clipboard !!!!!

    Yvan KOENIG (from FRANCE jeudi 23 avril 2009 21:47:49)
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !, Mac OS X (10.4.11)
  • Level 8 Level 8 (41,760 points)
    Currently Being Moderated
    Apr 24, 2009 6:14 AM (in response to Roger Wilmut1)
    On April 22 I wrote:


    So with this scheme it would be useful to re-design the script.
    If you try do apply the process and get the wanted result,
    it will be time to try to build a script on this basis:

    select the range of records to transfer
    execute the merge task
    save the doc
    open it in Pages
    Select All
    Copy to the clipboard


    I wait for your response.
    Is the process matching your needs or isn't it ?

    Yvan KOENIG (from FRANCE vendredi 24 avril 2009 15:14:04)
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !, Mac OS X (10.4.11)
  • Level 8 Level 8 (41,760 points)
    Currently Being Moderated
    Apr 24, 2009 12:06 PM (in response to Roger Wilmut1)
    I really don't understand how you read.

    I re-repeat:


    If you transfer the contents of the database in a Numbers document, you will be able to define a Pages document in which you will be able to merge with carefully designed TABs too.
    I already posted a script allowing us to merge several records in a single sheet.
    With this tool, the basic uses of the AW DB are reproduced in iWork.



    So with this scheme it would be useful to re-design the script.
    If you try do apply the process and get the wanted result,
    it will be time to try to build a script on this basis:

    select the range of records to transfer (in a Numbers document)
    execute _the merge task_
    save the doc
    open it in Pages
    Select All
    Copy to the clipboard

    After that you will be able to put the datas where you want.

    The clipboard would be used only when the datas are carefully formùatted in Pages.

    Yvan KOENIG (from FRANCE vendredi 24 avril 2009 21:06:50)
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !, Mac OS X (10.4.11)

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.