Using InDesign CS6 Server Scripting, Can I Hide a Specific Layer In A Document? - indesign-server

We have a system that allows users to fill in variable data in InDesign IDML files. As information is entered, an InDesign server renders a JPG of the IDML for user review. Once all data is entered, the user can then request a PDF (which is also rendered by the InDesign server).
We would like to allow the users to have a further level of customization by allowing them to choose between a few options for certain pre-determined content layouts. This content would be included in the IDML file as separate layers.
Our current thinking is that we could add the optional content to the IDML files on different layers and as a part of the export process show/hide the layers based on the user's choices.
Is there a way to dynamically show or hide layers using the InDesign server scripting interface? The documentation is pretty sparse on what can be done.

There seems to be some detailed automatically generated documentation here about the Adobe InDesign CS6 Server (8.0) Object Model.
In particular, the page for Layer says that it has a read/write property called visible. This seems to be what you're looking for.
It looks like the path to get to the layer is something like this: Application.Documents.firstItem().layers.itemByName('layerName').

Related

Can I make CNC Editor with HTML5?

I would like to make my own CNC Editor.
I am looking for some guidance. I don’t know if it is even possible with HTML5. But it would be great if I can. If possible, please list what I should research and learn.
I don’t need it to be online accessible, I will only have it on my computer. I will be accessing it via local network from multiple different computers. I don’t want it accessing the internet, because it’s not always available.
Desired Features:
⁃ Read and Write files with different extensions (all files used are easily opened in notepad)
⁃ Store and retrieve data from a simple database file.
⁃ Make calculations
⁃ Have a text Editor window
⁃ Have a Display area for simple vector graphics depending on data loaded and provided by user.
It is possible but requires a lot of work. I would say that these are technologies you would need to master in order to pull this off:
Node.js (use express.js) - for storing and retrieving files from database and for reading/writing local files with extensions you want (server-side)
Vue.js or Angular.js or React - for building frontend interface to manipulate your vector graphics. It can also do calculations and It's good with svgs and that kind of stuff.
Electron.js (not mandatory) - it wraps it in native-app like experience. This framework actually gives you ability to write desktop apps for any os and arch.
So as I said, It would be a lot of work but its possible in the end.
Funny coincidence is that my brother is planning to build CNC machine so I might be doing this as well in next couple of months. Feel free to contact me if you need any further help!
UPDATE: You cant do it with just HTML5. It would be like trying to make wooden space shuttle.

Game Maker Studio HTML5 localStorage issue

I'm embedding GMStudio game in browser using . I need to send some data to the game from site's frontend in JSON and to receive some data from the game in frontend to make consequent actions.
So, my idea before was to save data in cookies/localStorage and to get it in the game somehow, using HTTP functionality or DLL's. Also, I'd like to emit messages from the game using window.parent.postMessage and receive them in frontend correctly.
Alas, I did not find a way to implement this. I hope there's some consistent approach to this problem about which I do not know.
The backup plan is to use Game Maker http_post_string and web sockets to get user's data before game's start and to make frontend do something after game's ending. It's clumsy and insecure, however.
The standard approach is to make a JavaScript extension.
That is done by creating a blank extension, adding a blank JS file to it, defining the functions via the context menu on it, and then adding the implementations into the JS file. Then you'll be able to call them from GML side as per usual.
This way you can access LocalStorage\Cookies, transmit\receive data from JS backends, and overall mess with the runtime as you please (with various degrees of understanding required to access internal data).

SCORM file that launches website using URL

We are currently using an LMS system for an online course. Almost all of our material is online. We are starting to SCORM format our online material. Instead of attempting to physically merge all of our HTML pages within a SCORM file, isn't there a way to simply have the SCROM file launch a given URL automatically? All of our material needs to be in SCORM format in order for our LMS system to track the time spent in our LMS course which is why we are making the switch.
Is there a way to instantiate this in the manifest.xml or launchpage.html?
Some companies including mine, use a local file which launches a frameset to our websites. The SCORM runtime communication between the two sites can happen using a HTML5 postmessage. For example, if a learner gets a score on your website, you can send the information to the code that sits in that small local file on the LMS. In turn, you call SCORM runtime from the that file. This can also happen in reverse. Here's an example by Claude Ostyn:
http://www.ostyn.com/standardswork/xdomain/remotecontentdemo.htm
At minimum if you can run the base index.html file and point your CSS and JavaScript to your content server or CDN that would solve the double IFRAME or trying to get around browser security due to X-domain issues with your domain trying to access the LMS's runtim API on their domain.
This does cause a obvious authoring challenge or at minimum a massive search and replace in files on your project.
Only other way still requires the IFRAME workaround to get around it.

How do I save the current frame to be loaded later?

Hello everyone and thanks in advance for any answers.
What I am trying to develop is quite difficult and I fear it may be beyond ActionScript and Adobe Flash CC, however I will try and see.
I wish to create an app that allows users to upload their own image (bitmap) and that becomes the background of the frame, they can then drag shapes onto points in the image and add text so that they can click the circles and see what info is said about that point.
I am unsure how to achieve certain aspects of this.
The main functionality I require assistance with is saving the scene as a swf so that it can be loaded back into Flash Player from within the Flash App.
Is any of this achievable?
Yes, this app is rather non-trivial, but very doable (and it has been done many times before.)
The main functionality I require assistance with is saving the scene
as a swf so that it can be loaded back into Flash Player from within
the Flash App.
This isn't necessary to do what you describe. If the user has uploaded the image to a server, you can also store user information on a server that describes the other aspects of the user's screen (shapes, text, etc). Then you only need to load in the data and reconstruct the scene.
The basic flow would be:
User selects an image using FileReference/browse() then use FileReference/upload() to send it to a server-side script (for example PHP) that stores the file to a database.
User performs the actions you describe to create shapes, text, etc, and you record it as XML or JSON format.
You send the XML or JSON scene data to the server using URLLoader.
You associate the scene with some kind of identifier. A server-side query can now take that identifier and return the XML or JSON scene data.
To display the scene, you load the XML or JSON scene data using URLLoader and reconstruct it using Loader to load remote images, and re-create the shapes, text, etc from the scene data.
The end result would enable you to share the scene with anyone using the SWF that is able to reconstruct the scene.
You could use this same approach without a server, and instead store the scene data locally using SharedObject or FileReference/save() in the Flash Player, or File or EncryptedLocalStore in AIR. All these methods would also allow you to store the data as AMF (ActionScript objects).

Adding text / input box rendering to Access for a guided user interface experience

For software used in a call centre guiding agents through a set script they must follow while on telephone calls, with the script branching dependant on answers to questions given - My system uses a MS Access / VBA front end (isnt web based due to speed, phone integration), 'call scripting' is coded in VBA when needed, but what if i want move to a more complete solution?
Is hosting a HTML/ms webbrowser control the obvious platform to build call scripting on?
A manager view will also be needed allowing managers to create scripts, divide it into parts, specify routing rules that determines the path through the script, link input boxes (ie question answers) back to database fields, specify validation rules as well.
Thinking about the complexities of building the manager view that translates the intended script into HTML/Javascript, is creating my own simple doc description language with tags for just the features i need and a 'rendering engine' in VBA a solution you might consider for this?
Ive thought about creating scripts out of standard Access controls, using relational table structure to hold the info of what controls relate to what parts of scripts, validation, routing options etc but i think due to Access' lack of runtime control creation this will be more painful than a rendering engine that takes a script written in my own doc desc language and displaying it.
What suggestions have you for the implementation of this?
The actual user interface requirements of the user-facing part of your system seem to be pretty minimal (ask question, get answer, branch to "next" question). I don't think there's any "obvious" platform to use. As always, a browser based system makes it easier for geographically scattered users to use a centralized system but will probably cost more in terms of development.
The manager-facing part of the application is more interesting and for that I'd probably suggest a desktop application rather than a browser based one. I can see this relying on a lot of drag-and-drop and line-drawing type functionality and that kind of stuff is still easier to do on the desktop, at least in my opinion.
Assuming that you can clearly define the kinds of question routing and decision points that a script has, and these decisions are relatively simple, I probably would write your own specification for how a survey is represented. The manager-facing application would create, edit, and save a specification and the user-facing application would read and step through one.
Given my personal skill set, I'd probably write both applications in Delphi, develop an XML format to represent the survey specification, and consider either XML or relational storage for the back end depending on what you actually wind up doing with the data.
I'm inclined to agree that a web interface is optimal for something like this, however WPF is a great alternative as well with many of the advantages of a web interface along with the power of a desktop application. Both web and WPF would give you considerable amount of control over how the application looks and feels, leveraged with all the power of the .NET framework. One drawback of a web app is that you have less ability to interact with the phone system directly, but I'm sure that's a problem that can be mitigated fairly easily with some AJAX. A big plus for the web platform option is that you'll have access to tons of client-side interactivity libraries like jQuery, which will allow you to polish the application with greater ease; with WPF you would likely find yourself paying for a lot of the fancy UI controls.
There is quite a few survey and question (test creating) systems built in access. I don’t see any real issues in using access as opposed to whatever system.
The advantage of HTML or text based systems is they tend to support a more dynamic type of screens.
On the other hand, for questions and display of text, in access a great trick is to place a sub-form control on a form, and then at runtime simply “set” what form is to be displayed in that sub-form (the source object properity). In fact, in access 2010, the nav control does exactly that and it displays forms as a sub-form.
Also for access 2010 we can create web based applications. In this video you can see that the half way mark, I switch to running the application in a standard browser.
http://www.youtube.com/watch?v=AU4mH0jPntI
However, the above means little here, as I not sure what you mean by some type of rendering engine. Each question + response is simply going to be some text on a screen, and thus you can simply display/change that text by changing the underlying reocrdset.
And, if you want nice formatted text with different fonts etc, well access 2007 now has support for rich text (markup text). So I don’t think you really need dynamic screen creating. Between changing the record source to display whatever text you want, and that of being able to display different forms (templates) on the fly by changing the sub-forms “source object”, you can well change part of your screen to display different text boxes with very little code.
On the other hand, if you have all of the .net tools and want to create a browser based application then you are free to do so. I suppose you could also wait for access 2010 to create a browser application.
If you willing to keep this simple, then access is a great choice. If you need a browser based application, then I don't access is the choice here.