[JS][CS35.5]Place a previously created item/textframe/group onto a page/into a textframe anchored
Hi all. I'm an experienced programmer but very new to indesign scriping. I've been working through a book and some tutorials and it's coming along pretty well. I'm also no Javascript pro.
My project is to parse some inDesign files that I have made as "templates" and fill in placeholder text I have created with data from a file. The data can be single words or phrases or long sequences of styled paragraphs. That's all working. I can even do it without making the document active which is especially pleasing because it feels more automated not to have the new document open while the script is running.
However, now I want to do something I did with my previous system (OpenOffice Writer + Docmosis) which is to place a little group of a textbox + icon with a drop shadow in certain parts of my document.
Here is an idea of what I mean: http://fireplan.ca/images/stories/firewatch.png
Since I add large amounts of text and add pages manually to flow it I need to make sure this box will stay with the text it is associated with (in this case, the fire watch paragraph). I don't know if there is a good way to copy this element in from another document or to create it with a script or what. My solution so far has been lame. I create the textFrame, include subframes and graphics as I see fit, and then put it in the document with a name (InfoBox) and set it to be invisible. Then, if I run across a situation where I want to include it, I do something like:
var sourceTextFrame=findTextFrame("InfoBox",theDoc);
var objectDupe=sourceTextFrame.duplicate();
objectDupe.visible=true;
objectDupe.name=objectDupe.name+"-placed";
app.select(objectDupe);
app.cut();
app.select(theStory.paragraphs[newParagraphIndex].insertionPoints[0]);
app.paste();
/* This code an be optimized and improved I'm sure but for now it's doing the job and is not the basis of my question */
function findTextFrame(frameName,theDoc){
var allItems=theDoc.allPageItems;
for(var a=0;a<allItems.length;a++){
if(allItems[a].name==frameName){
return allItems[a];
return null;
Basically I paste a visible copy of the info box into my main textframe in the appropriate place. This technique of using app.select, app.cut, and app.paste just seems lame. It also means I have to make the document the active document so I can use cut and paste.
Any suggestions or ideas about how to achieve this sort of thing more cleanly?
Just a quick follow up. The direction I thought I would go on this if I was more experienced would be to look at the Indesign CS5.5 scripting guide and focus on the area about creating an anchored frame. This basically creates a text frame inside an existing frame and anchors it there. It seems like there should be some way to use a similar approach to move the contents of my existing objectDupe into this anchored frame, or simply add the objectDupe instead of creating the anchored frame in the first place.
So for example the code in the scripting guide is something like:
var myInlineFrame = myInsertionPoint.textFrames.add();
I thought it would be nice if you could do something like myInsertionPoint.textFrames.add(objectDupe);
or objectDupe.moveTo(myInsertionPoint);
var myInlineFrame = myInsertionPoint.textFrames.add();
myInlineFrame.textFrames=objectDupe.textFrames;
or
myInlineFrame.contents=objectDupe.contents;
Of course, I realize none of these things will work, but it just seems like there should be a way!?
Perhaps I will have to look further into snippets. I saw a blog post that allows you to place snippets inline by putting them in a library first.. maybe that'll work.
Any further comments are more than welcome!
Similar Messages
-
API for creating item catalog group
Hello,
Does anyone know which API's are used for creating the following Inventory objects:
1. catalog group
2. descriptive element
3. descriptive element value
4. manufacturer part number for master item
Thanks
SimonIf there are no APIs listed at http://irep.oracle.com, then there are none publicly available. There may be internal/private ones - you will have to peruse thru all of the API code in the database to see if there are any - if you find any and plan to use them, Oracle will typically not help in troubleshotting issues you may run into. You could also open an SR asking if there are any APIs available for use.
HTH
Srini -
Geotagging - how can I edit new places that I have previously created but with typos, errors etc? How do I delete a place I have set up? Then I could create a new, correct entry. I'm using iPhoto '09.
Is it OK to reply to my own question?? Thanks to the related posts that appeared AFTER I'd made the post above, I learnt about the 'Manage my places' item under the Windows menu. I felt a bit dumb not knowing this.
BUT it doesn't completely resolve the issue. The info shown in the EXIF (using opt-cmd-I) under Places has the place name I choose, but it is followed by a few other lines that are incorrect and do not seem to be anything to do with any data I can see under 'Manage my places'.
Can anyone explain where these other entries might come from, and how to edit them? -
Creating items to place on a tray
I need to create items to place on a tray. So if I have a tea, coffee, glass of water, salt, sugar, etc.
What is the best way to program this?
I am thinking of having a tray class which has an array of TrayObject Types. This will set a limit to what can be placed on the tray.
Each item (tea, coffee, salt, water) will be encapsulated by the TrayObject interface. So it would be like the factory pattern I would use.
If I'm correct so far, what sort of methods could I put in the TrayObject interface. I thinking things like name(), isDrinkable(), isPourable(). Not sure about the methods though.
Cheers for any helpDecoder wrote:
I am thinking of having a tray class which has an array of TrayObject Types.Rather than an array, I'd suggest using a List. It's a good habit to get into.
This will set a limit to what can be placed on the tray.Like T.PD, I think there are other ways to do that better.
Each item (tea, coffee, salt, water) will be encapsulated by the TrayObject interface. So it would be like the factory pattern I would use.Doubt it. Don't overthink this. Just create a class, like TeaCup, that implements your TrayObject interface.
I'd also suggest that what you're putting on the Tray are objects, like a TeaCup, or a SaltCellar, not consumables like Tea or Salt.
If I'm correct so far, what sort of methods could I put in the TrayObject interface. I thinking things like name(), isDrinkable(), isPourable(). Not sure about the methods though.Following on from above, I'd go more for things like 'isHot()' or 'isBreakable()' (in addition to T.PD's suggestion about "footprint" info), rather than methods about what the objects contain.
Winston -
Hi,
I going to be changing the naming and structure of support groups and incident tier groups. I'd like to know what effect this has on all previously created work items and the reporting on those work items.
In addition, I am also adding list items to impact and risk list to change incident prioritisation settings and want to know the effect it will have on the live work items and historical work items.
Cheers,
PeteWhen you're thinking about editing enums in a live system, it's important to know a little but about how they work on the back end.
each enumeration entry essentially breaks down into a GUID and a display string; there are other properties, like Parent, Ordinal, InternalName etc, but those don't come in right now. when you use a console form to look at an incident, the control reads
the GUID that is stored on the incident in the property in question, and then goes and collects the list that property references, and shows you the correct display string for your language. the specifics are not important, but the fact that what's stored
on the incident is that system generated GUID is. when you edit a list, each entry has a unique GUID, that can't be changed or seen through the UI.
Adding a new entry will add a new guid and a new display string. this option will be available the next time the form is opened. this works pretty much the way you would expect it to.
Renaming an enumeration keeps the GUID the same, but changes the display string. any incident with that GUID will see the new string, and the data warehouse will be updated with the new string, so
historical incidents that had that value will now have the new display string.
Deleting an enumeration will remove the entry from the list and break the mapping of that guid to the display string, but does nothing to the incidents that have that guid on them. the net-net of this is that any incident with that guid
will have a value (i.e. not null) but it won't have anything to show to analysts, so it will look like it isn't set. the datawarehouse keeps those mappings even after they are deleted, so removing a mapping will not affect reporting.
the end of this is that you should re-classify any items before deleting an enumeration, you should only rename an enumeration if that new name makes sense for all work items for all of history. it is possible to reorder enumerations while keeping their
GUIDs, but it requires some XMLing. I've posted about it elsewhere in this forum, so let me know if you need a link -
Dynamically creating a Record Group based on Previously entered Record Grou
Forms [32 Bit] Version 10.1.2.3.0 (Production)
Hi,
I know how to dynamically create a record group based on a query and putting the code in When new form instance.
My query is. I have a form which has multiple Record Groups and the user wants to dynamically create subsequent groups based on previous groups.
For example
I have a record group with selects a Location,
when the user selects the Location from a list of values
the 2nd record group called 'Cost Centres' will have to filter out only those with the locations selected above.
How can I populate the 2nd record group at run-time when I do not know what site the user will select?
If I simply populate in when new form instance as in location and just select everything, the list of values populates.
CC field is a LIST ITEM and the list style is a POP LIST, it is not required.
I have put the code in the Location field in the when-list-changed trigger.
I am getting this error:
frm-41337: cannot populate the list from the record group
here is the code:
DECLARE
v_recsql Varchar2(1000); -- The SQL for creating the Record Group.
v_recgrp RecordGroup; -- Record Group
v_status Number; -- Return Value of Populate_Group function.
c_where VARCHAR2(1000);
BEGIN
IF :location = '1' THEN
c_where := ' substr(cost_centre,1,2) in (''01'',''02'')';
ELSIF :location = '2' THEN
c_where := ' substr(cost_centre,1,2) in (''02'',''03'')';
ELSIF :location = '3' THEN
c_where := ' substr(cost_centre,1,2) in (''01'',''11'',''07'')';
ELSE
c_where := ' 1=1'; --EVERYTHING
END IF;
v_recsql := 'SELECT cost_centre, description FROM cost_centres where '||c_where;
-- Create the Record Group
v_recgrp := CREATE_GROUP_FROM_QUERY('v_recgrp', v_recsql);
IF NOT ID_NULL(v_recgrp)
THEN -- No Error, record group has been successfully created.
-- Populate Record Group
v_status := POPULATE_GROUP('v_recgrp');
IF v_status = 0
THEN -- No Error. Record Group has been Populated.
POPULATE_LIST('block.CC', 'v_recgrp');
END IF; -- IF v_status = 0
-- Delete the Record Group as it is no longer needed.
DELETE_GROUP('v_recgrp');
END IF; -- IF NOT ID_NULL(v_recgrp)
END;thanks for your assistance.Hi,
Once record status gets change for block you can not populate/repopulate the list item. Keep those list items as non-database item with different names and create different items as database orignal items. Than assign the values in WHEN-LIST-CHANGE trigger to the actual database items.
-Ammad -
Question about "Create Item" page
Im working on trying to Insert a new item into a Self-Service Web Applications page.
As part of my research, I have been looking at this doc:
Oracle® Application Framework
Personalization Guide
Release 11i
Part No. B25439-02
From:
http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115fwkpg.pdf
The document does not seem to go into much detail about how to Insert an item on a page. I also checked the "OA Component Reference" document.
I checked the online help via "Create Item Page" - e.g.
http://oursite/pls/PSAT/fndgfm/fnd_help.get/US/FND/CUST_PERSADMIN_CREATEITEM.HTM
Again, that doesn't give a lot of information.
As part of my testing / research, I would like to add a new Item to a page, and have the value of the item to be taken from an existing SQL Query.
For example, in iProcurement, when viewing a Requisition Details, e.g. via this page:
http://oursite/OA_HTML/OA.jsp?page=/oracle/apps/icx/por/reqmgmt/webui/ReqDetailsPG&reqHeaderId={!!BX6R96mkQOcfNZ60BeTaJQ}&retainAM=Y&addBreadCrumb=Y&_ti=245778094&PersonalizationParam=PersonalizationParamAdmin&oapc=12&oas=mYF7zP1VI7xoAWcUQHTEkQ..
I would like to add in the "NOTE_TO_AUTHORIZER" field from the "po.po_requisition_headers_all" table.
From looking at the "About this Page" link, I can see there is a View Object called "oracle.apps.icx.por.reqmgmt.server.ReqHeaderVO".
This ViewObject contains an Attribute called "NoteToAuthorizer" with a Type of "java.lang.String".
When I go to the "Create Item" page, and choose and Item Style of "Message Styled Text" there seems to be no way to say which database field you want to include.
From looking at a previous customisation that a developer did, I can see you can pull in an Attribute via the "View Attribute" field, and link in the VO via the "View Instance" field.
When inserting database values into a Self-Service page, can we only insert Attributes, and not any of the other regular fields from View Objects?
Apologies for the rambling essay.
Any advice much appreciated.
ThanksHi Jimr,
In OAF sql queries are represented by View Objects and columns of query will be represented by View Attribute.
For every column in query there will be corresponding view attribute name, so while adding any item on self service page which represents data from database you need to specify view instance name and view attribute name, which will specify which column and from which query it will show the data.
*"When I go to the "Create Item" page, I can't work out how to tell Oracle that the Item I want to create should be the "NoteToAuthorizer" field from the "ReqHeaderVO" ViewObject."* so ReqHeaderVO1 will be the instance(by default OAF generates instance like this) and "NoteToAuthorizer" can be mentioned in View Attribute name property.
Let me know if you need further clarification.
Regards,
Reetesh Sharma -
Can we create items dynamically in forms 6i??
Dear All,
Is it possible to create items,i.e. Text items,display items etc. dynamically?
Suppose I select Table name EMP,then it must get all columns from database and place it on form.Now I change table name from EMP to DEPT,now it should get all columns for dept table and place it on same form removing all EMP table colums.I should not have to call another form,i.e. it should be strictly done through single form.
Thanks in advanceYou can make a form with 10 or more items (depends on the maximum number of the columns you have) and place them in a non base table block. Then you populate the block with a cursor and if you press a button you can populate the same block with another cursor making visible only the columns you need.
Hope it helps you,
Fabrizio -
I am technologically challenged senior citizen who recently upgraged to Pages 5.1 from what I think was iWorks '08. I now find that I am not able to open any of my important previously created Pages documents. I receive a pop-up that tells me that they are too old and must be saved in Pages'09 first. I no longer have the disk for iWorks 08 and don't have Pages '09 on my iMac. Any ideas how I might get these documents open?
You should have the old Pages '08 inside the iWork folder, inside your Applications folder.
Open your old files in Pages '08 > Menu > File > Export > Word
Pages 5 can then open that Word file.
Peter -
Hi everyone !
Before proceeding to the description below I think it´s important to say that I´m using NI USB-6008 as DAQ device and the driver used is DAQmx 7.5.
I´m currently developing an application into which I intend to be able to have complete control of the DAQ device being used, i.e, I´ll be able to create, delete and change the configuration of global channels and tasks previously created, among other things.
To achieve the ends specified above I´ve already developed two vis, one to create global channels and the other to create tasks, and these two are doing a fine job. After this, I thought I came to the easy part ... I think I couldn´t be far for the truth! I thought that everything I should do was to specify which channel or task I´d like to configure and then use a property node to get the results I wanted, but it´s not working ...there are some DAQmx property nodes I thought I could use to do it but I didn´t find a way to change the configuration of the global channels, and none of these property nodes seemed to work, i.e, although the simple vis used to test them ran the chosen parameters didn´t alter at all, after each execution I used MAX to see if they had changed, and to my chagrin they hadn´t.
Can anybody lend me a hand with this problem? As always, any help would be deeply appreciated !Hi Giovani,
There is a developer zone tutorial that discussus some advanced data acquisition features including programmatic saves of NI-DAQmx tasks, global channels, and scales. This tutorial also includes an example program.
I wrote a short program that creates tasks in MAX. Whenever I wanted to change a part of the task, I would just change that feature in the example program. Take a look at the examples and please let me know if you have any further questions.
Regards,
Hal L.
Attachments:
create task example.vi 33 KB -
Getting HTTP 404 - File Not Found when creating Items
This happens when I try to create an item of any type. I can edit items already created, but I cannot create any new items.
Take the Text Control for example:
When I click on the Text item icon, I get the page that prompts for the Text Control Type. I select one, then I wait and get the HTTP 404. This happens with all items. For items that do not have subtypes, I get the error immediately.
Any suggestions?I have some major work to do. This might require a call to Oracle.
Udump trace file reveals the following for each attemp to create an item:
ksedmp: internal or fatal error
ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [_opidsa+360] [PC:0x2080540] [ADDR:0x0] [UNABLE_TO_READ] []
Current SQL statement for this session:
select
nvl(htf.escape_sc(p.plug_name),wwv_flow_lang.system_message('CREATE_ITEM_WIZ.NO_REGION')) plug_name,
i.item_sequence,
i.name,
i.prompt,
nvl(i.item_plug_id,0) item_plug_id,
i.DISPLAY_AS
from
wwv_flow_step_items i, wwv_flow_page_plugs p
where
i.flow_step_id = :FB_FLOW_PAGE_ID and i.flow_id = :FB_FLOW_ID
and
p.id (+) = i.item_plug_id
order by nvl(item_plug_id,0), item_sequence
I shut down the database. I get this when attempting to restart:
SQL>
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORA-12528: TNS:listener: all appropriate instances are blocking new connections
SQL> startup
ORA-01041: internal error. hostdef extension doesn't exist
SQL>
Message was edited by:
MartinWDC -
Window vs view - how can i jump to a view which was previously created?
Hello!
how can i jump to a view previously created without the push or pop to view function?
I have a UITabBarController with several view(s) (controllers)* and in one of my views i am using a navigation controller which pushes to various views. At the end, i would like to have a button, where the user can go back to its initial view (when the application is starting) i guess, that it has something to do with the rootview Controller.. the problem is: i dont have a root view controller because i am working with the TabBar example from apple, which is using the IB.
thx for any hints..
alex
*which still is not working.. availiable at http://www.learnclip.com/iphone_tutorials/ViewPusher.zipYou know what, about 30 seconds ago I figured out what I did. I set the Quiz preferences to “Required to pass before continuing” instead of “Required to take quiz”.
I am sure Action Script is the wrong term (I’ve only used Captivate for 2 weeks). I applied an Advanced action to skip over the knowledge checks. I got the tutorial from this link:
http://blogs.adobe.com/captivate/2011/07/excluding-knowledge-check-questions-when-reviewin gretaking-the-quiz.html
Thanks for replying!
Tiffany Robinson│Instructional Designer│Design and Development Team
Email: [email protected]<mailto:[email protected]> │ Phone: 386-218-3577
Check out thousands of free books and reports from Books 24x7 in the Kelly Learning Center!
Kelly Services, Inc. -
I have a MacBook Pro , Model Identifier MacBook Pro8,2 , MAC OX S 10.7.4
I noticed that if I open Final Cut Projects created on other/older models MacBook Pro Laptops or MacPro Desktops, the fonts used in the previously created FCP projects, change their font spacing! which distorts the look of the Text that was written, by oevrlapping on other things that were put & present on the screen.. Another similar probelm is that the Vector shaped used for example to highlight certain words or shapes, also change their position on the screen so that they no longer highlight exact things that we once used these vectors to highlight or outline... Anyone knows how to solve this problem please?? I made sure that the same fonts are available in the Library in both old and newer computers...
thanks in advance..You might want to take your question to the FCP forum - if you copied all fonts to your Library>Fonts folder and restarted they should be recognized by all applications. I know that this works for Adobe products, anyway.
Clinton -
We had to swap my sons ipod touch for a new one due to it being broken. I need to know how to reload the previous purchased items back onto the new one.
ThanksThey should be on the computer. Just sync them as you did the last ipod.
If you failed to put them on the computer then redownload them using the instruction in the article your reference above. -
Workflow does not start automatically on create item (yet another time)
The topic has been discussed broadly throughout different forums, but I didn't find the solution to my issue yet and hope you can help me out with ideas to sidestep the difficulties created by Microsoft.
I have one list 1 in Site Collection A, and one list 2 in Site Collection B (PWA site collection). I need to copy an item from list 1 to list 2 with some values. I use a "Call http web service" action to accomplish
that as I need to copy informatin cross site collections.
The "Call webservice" is in an App Step, because the user creating an item in list 1 does not have permissions on list 2. Thus, my item is created "by workflow" (not "by System Account") in list 2. Now I need a second
workflow to start on list 2 which will create a project in Project Server.
As I am working across 2 site collections, I can not use a SharePoint 2010 workflow with impersonation step for list 1 as the "Call a webservice" action is not available for SP2010 workflows and "Copy item" only works in the same site.
In Nintex I can impersonate the web service call - is this also somehow possible for SPD2013 workflows? Or is there any other possibility to get over this silly restriction of workflows not starting automatically on System account created items? Someway
perhaps to tweak the App Step in impersonating with another user account?
Any help appreciated!
I really can't understand, that this common requirement is still not solved by Microsoft :-( I found more threads on the topic than I can count, so this seems to happen quite often... at least they should finally offer a proper way of doing some kind
of impersonation with the calls so we have a chance to change the creating user account.Hi,
As I understand, you would like to use workflow to copy list items cross site collection.
So far it is not supported with OOB workflow option, here is an codeplex workaround:
https://spdactivities.codeplex.com/wikipage?title=Copy%20List%20Item%20Extended%20Activity
Please check if it can be help.
Regards,
Rebecca Tu
TechNet Community Support
Maybe you are looking for
-
Photoshop will not work in Yosemite OS 10.10
Yosemite looks cool but it did not warn me that Photoshop and my wacom tablet would not function. I actually have Photoshop CS5. Which as far I am concern worked great in Mac OS X. I was given warning after downloading and installing I need to to
-
How to install mini SAP in MS SQL Server 2005 Express?
Hi, is anyone know how to install the mini SAP v4.6 by using MS SQL Server 2005 Express? I get error when connecting to the Database at 88% of the installation. Please help. Thank you.
-
I am unable to get or send mail on my mac acounts and don't seem to be able to fix it
I have a two year old i mac and a new macbook pro with mountain lion. I have been with mac for many years but as of a few months ago, i am no longer able to send or recieve mail on my mac account. I have icloud and from everything I can see I have al
-
After clicking on an open tab, how to make the focus automatically go to the body of page? Right now, clicking in an open tab and using arrow keys now moves through the open tabs. I liked the old versions where right after clicking in a tab you could
-
Trouble uninstalling quicktime
im trying to uninstall quicktime b/c my iTunes is messed up (i have to uninstall both iTunes and quicktime in order to fix the problem, according to other wall posts). When i try and uninstall this message comes up: Unhandled Exception error number: