Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 24
  1. #1
    Join Date
    Dec 2003
    Posts
    891

    Building pages from script

    What is the easiest way to take a design time built page, and build a script file that can be used to build it at run time?
    I want to build a catalog. To do separate pages would leave the project with over a 100 pages.
    I want to build each page in a project first, and be able to create that page at run time on a single page in any project.
    The only three objects that need to be created is a para (or two), label and an image from an image file.
    I know I can build the page using Page.Create.Object in the On preload Event script, then copy the script into a lua file. But that would entail building object properties tables manually.
    It would be much quicker to use design time to create the page, then export the page as a script or XML file.
    Page export from the menu will only create a file that can be used at design time.
    Here is an apz to show what I mean.
    I want to move the content (at run time) of the Display page to Page 1 by loading a script/xml file in the on preload event of Page 1.
    Any help would be appreciated.
    Attached Files

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    You don't need to create a new page each time. You can do everything with just one page. Just load the paragraph text and image into the objects as needed. Ideally store all the info in a database. One record for each page in the catalog.
    Dermot

    I am so out of here

  3. #3
    Join Date
    Dec 2003
    Posts
    891
    The problem is there may only be 1 para and an image on one page, three images and two paras and 3 labels on another. The image sizes change. the positioning of all the objects change. etc.
    To create objects on a page at run time requires a table of properties for each object to be in the script. Font, font size, dimensions, load a file or text, positioning, etc for just the paragraphs.
    These tables would have to be manually created in the On Preload script, then copied and pasted into a .lua file to be used in another project..
    Wouldn't it be simpler to build the page in design time, then export the script for each page to be used at run time? IF there's a way to do it? Especially for 100+ pages?

    If there was a way to create .lua or an .xml from the Page Export menu (page.xpg), that is what I am talking about. However, opening the .xpg in notepad is pretty useless.
    Last edited by Roboblue; 02-12-2008 at 07:41 PM.

  4. #4
    Join Date
    Dec 2003
    Posts
    891
    So I take it that no one has had a need to export a design time created page that will be exported into a scirpt that can be used to build a page at run time?

  5. #5
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    There is no way to create pages at runtime. Based on what you said I think it would be easier to make a html page for each page of the catalog and then just have one page with a web object and load in the appropriate html file.
    Dermot

    I am so out of here

  6. #6
    Join Date
    Dec 2003
    Posts
    891
    Thanx Dermot, that would be quicker, but not as interactive as a regular AMS page.

    I have put in a suggestion to add a feature that will either export the page as a script, or add an action to allow Runtime to use the .xpg.

    In the meantime, I have started working on a Page Builder.apz that will allow you to build a page in design time, then when previewed, will have menus to get the page, and object properties, which is in tables, singly or by enumerating the whole page, then putting the values of the tables into a lua file for that object, and then adding the objects as part of the whole page script. Then giving an option to zip all resource files into a directory structure that can be unzipped into another project later, or directly copy the files to another project, etc.
    All you have to do is set the project size to the one you are building pages for, then build the page then preview the project an click a few menus to get the script and files exported.
    It will be a fun project and when I'm done, I'll share it.
    I have already started and almost have the Para object template built. I will have to build a template for the page and all available objects tables, but only once.
    Anyway, I am sure I will be back for help later.

    Does anyone else think they could use this utility?

    Also, if anyone has already done a project like this, PLEASE share it before I spend days on this one.
    Last edited by Roboblue; 02-18-2008 at 01:22 AM.

  7. #7
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    Roboblue

    If this is way off-base from what you're trying to do, just ignore these ramblings.

    Looking at your example, it appears that you are on the right track.
    You should be able to extract the -<Page> ..</Page> XML set (which I see in your example).

    <Page>
    <Name>Display</Name>
    etc.
    </Page>

    Change the name
    <Name>Page1</Name>

    Add the new <Page> set and rewrite to an am7 file as many times as necessary, immediately after the <Page> set for the 'Display page.

    I tried this manually with Notepad and it seems to work okay - it would need to be tested of course.

    So without writing scripts per se, you should be able to manipulate the am7 file using TextFile or SQL commands, merging in the <Page> sets as necessary.

    hth

    Personally, I don't know if I'd ever have a need for a tool like this, but one never knows. Definately a fun project though.
    Last edited by holtgrewe; 02-18-2008 at 07:56 PM.

  8. #8
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    I should have included the apz with the last post.

    This was built with Notepad by copying the <page> sets and renaming the page name. Obviously, one could do this through AMS as well.

    Maybe this will fuel some ideas.
    Attached Files

  9. #9
    Join Date
    Dec 2003
    Posts
    891
    I have already gotten a working partial system to write script from a page and export it.
    I am using a database that is setup for each objects property table template. I then use object get properties, then step through the table and put each parameter into the database. Then I pull the text out of the database and write a text file that is saved as a lua.
    This apz shows the same project except the Display page is now loaded from the script at run time. The script was mostly created from the utility, I just had to manually edit a couple of lines, but I'll fix that, later.
    I have the templates setup for Para, Image, and label property tables. But will have all available objects and the Page done when I share the utility.
    Maybe in two weeks, if I can get the time.
    Attached Files

  10. #10
    Join Date
    Dec 2003
    Posts
    891
    And yes, tis is a VERY ambitious project.
    I have been away from AMS for several months and maybe this project will get me back up to speed.

  11. #11
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    Very nice. Looks like it will be a handy utility.

  12. #12
    Join Date
    Dec 2003
    Posts
    891
    While building object templates, I realized that the plugins may be a problem.
    EX: I use a shape plugin to draw the red border.
    I could use a background image instead, but having the shape made me realize there's no build actions for plugins.
    Now, the plugin could be built on the blank page in the project as 1x1 pixel, then run a script setting the dimensions and some other properties from the lua file. Or just set it not visible. It would work fine. Just not as elegant as building it from scratch on a blank page.
    Is there a way to get the properties table for a plugin? (I don't think so)
    I'll put up an example tomorrow.
    Any ideas would be helpful.
    Last edited by Roboblue; 02-18-2008 at 10:41 PM.

  13. #13
    Join Date
    May 2006
    Posts
    1,443
    nothing impossible
    an example from me
    it uses xlm as database
    Attached Files

  14. #14
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    Amazing stuff.

    You guys are light years ahead of me.

    I'll stick to the AMS GUI however - I try to avoid the 'grunt' coding as much as possible. I don't want to make things more complicated than they need to be. lol

  15. #15
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Quote Originally Posted by reteset View Post
    nothing impossible
    an example from me
    it uses xlm as database
    Mirrored on amsuser.com:

    http://www.amsuser.com/ams/example/D...S7-reteset.apz

    Thanks reteset.
    Intrigued

Similar Threads

  1. Server script decryption error on Chinese Windows XP
    By SvenskLars in forum TrueUpdate 2.0
    Replies: 6
    Last Post: 10-11-2010, 02:47 AM
  2. Tree menu
    By Brave Heart in forum AutoPlay Media Studio 6.0
    Replies: 17
    Last Post: 05-20-2009, 10:23 AM
  3. Replies: 1
    Last Post: 05-11-2007, 11:24 AM
  4. .NET 1.1 Dependency Script Questions
    By drpepper in forum Setup Factory 7.0
    Replies: 1
    Last Post: 01-03-2006, 02:04 PM
  5. How can I know the FS Command name of a movie???
    By yoske in forum AutoPlay Media Studio 5.0
    Replies: 27
    Last Post: 01-01-2005, 10:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts