View Full Version : Automatic Keyword Creation for all pages in the project according to button names
hliobasilema
03-31-2009, 08:32 AM
Here is the deal. I have built a project containing about 50 pages. Then i decided to create a keyword index using the Application.MakeKeywordIndex built-in functionality. But to my surprise i had forgotten to manually enter info in the keyword field of the pages.
So ultimately i am trying to automate the process of initialising all keyword fields
at runtime. I want the keywords for each page to be the text displayed on the buttons of that page.
#############Solution 1###########to no avail
One roadpath that so far has been to no avail, due to not being able to reference other pages from within a page, is discussed in this thread:
Thread title: "How to reference buttons or other objects, in other pages?"
http://www.indigorose.com/forums/showthread.php?t=26692
The pseudocode of this roadpath is the following:
loop_though_all_pages_of_the_project();
for each page
do
-find all button objects and retrieve their text value
-store the result to a variable
-initialise the keyword field of the page with our variable above
#############Solution 2###########????
Has anybody something to propose?
mwreyf1
03-31-2009, 08:52 AM
Please don't open MULTIPLE posts for the SAME question.
It also makes it more difficult to get help as well.
hliobasilema
03-31-2009, 09:33 AM
I apologise for creating a new thread of my accord.
I thought it would help things conceptually.
holtgrewe
03-31-2009, 09:40 AM
Here's some things off the top of my head that may or may not give you ideas...
I don't know how effective it would be, but using the global variable [_NoExitScriptOnPageJump=true] it may be possible to navigate through each page to extract what you need using a startup global function...?
This may cause some goofy effects, but may give you some other ideas.
Another possibility would be to build a stand-alone program to access the information from the XML based .am7 source code and write it to output media, then read into your project module...?
hth
hliobasilema
04-02-2009, 11:39 AM
I don't know how effective it would be, but using the global variable [_NoExitScriptOnPageJump=true] it may be possible to navigate through each page to extract what you need using a startup global function...?
This may cause some goofy effects, but may give you some other ideas.
This doesn't seem as an option at all to me to be honest. Firstly will mess up other scripts and secondly it defeats the point of not having to navigate through each page.
Didn't know about this variable though, so still a good try.
Another possibility would be to build a stand-alone program to access the information from the XML based .am7 source code and write it to output media, then read into your project module...?
This seems to be a really good idea that i hadn't even considered. I'll give it a try (if it doesn't get too complicated and time consuming) and i'll post back to let you know what happens.
hliobasilema
04-06-2009, 02:10 PM
A big thanks to <<holtgrewe>> for the xml idea...:yes
I have created 4 different versions, each of them is described below and
can be downloaded at http://rapidshare.com/users/H142QA
**P.s. By downloading the files i have uploaded at rapidshare,
you help me get some extra points. This is the best way to thank me
**
Dynamically_Automatic_Keywords
--This Script automatically initiates each page's keywords according to the button names that the page contains.
--#***Important***#: If the pages contain already some keywords that have been entered manually these keywords will NOT be available!
--Created by hliobasilema...hliobasilema in greek means sunset.
--Tested and found to be working flawlessly in IndigoRose AutoPlay Media Studio 7.5.100.4.0
--Will work only with those versions that have the same XML structure inside MyProject.am7 file.
--To be used in conjuction with Dialog.PageSearch feature of Autoplay Media Studio, for realise the script effect.
--####USAGE###:
--Load the script on the preload event of the page you want to use it on.
--Application.LoadScript("HERE GOES THE PATH TO THE LOCATION YOU HAVE STORED AutomaticKeywords.lua file");
Dynamically_n_Manually_Automatic_Keywords
Only Difference with above: --#***Important***#: If the pages contain already some keywords that have been entered manually these keywords will aso be availabe
The following are for those of you that don't want to increase the system footprint/ memory load/ speed of your application
New_Project_with_Dynamically_Automatic_Keywords
--This Script creates a new project file with each page's keywords initiated according to the button names that the page contains.
--#***Important***#: If the pages contain already some keywords that have been entered manually these keywords will NOT be available!
--#ATTENTION#: Make sure that any of the variables in the script don't match with any other Global variables you might have. If that's the case either rename your variables or edit the script and declare the variables to be local.
--Created by hliobasilema...hliobasilema in greek means sunset.
--Tested and found to be working flawlessly in IndigoRose AutoPlay Media Studio 7.5.100.4.0
--Will work only with those versions that have the same XML structure inside MyProject.am7 file.
--####USAGE###:
--Load the script on the preload event of the page you want to use it on.
--Application.LoadScript("HERE GOES THE PATH TO THE LOCATION YOU HAVE STORED the script file");
--After you obtain new project file, load it but REMEMBER TO DELETE THE Application.LoadScript line that you created before.
New_Project_with_Dynamically_n_Manually_Automatic_ Keywords
Only difference with above: --#***Important***#: If the pages contain already some keywords that have been entered manually these keywords will also be available!
hliobasilema
04-07-2009, 11:39 AM
Files have been re-uploaded.
If you have liked my solution then please download it again to help me get some points.
Some extra nice pics are also included.
--By the way if you have any code improvements or any other idea let me know.
hliobasilema
04-15-2009, 05:40 AM
I just want to say thank you for the interest this thread has generated and to all those who have found my solution helpful and downloaded the files i have provided.
Though not anybody has posted a more efficient solution yet! By looking at more efficient ways of coding it is the only way to improve my coding. So if anybody has any ideas just drop it off.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.