Access Text Boxes (in a Keynote slide) in AppleScript - cocoa

Need some help to figure out how to access Text Boxes inside a slide in Keynote with Applescript. I tried to use ASDictionary but I couldn't find anything that would resemble a text box object. I fear that they are not scriptable in Keynote, but perhaps I can access them through Applescript Cocoa bridge? Any thoughts? Thanks!

If (and only if) Keynote doesn't provide access to objects on a slide via AppleScript, then you should do two things:
File an enhancement request at https://bugreport.apple.com/ .
Try examining the Keynote document directly by parsing its XML.
Keynote's XML document format is not documented, as far as I know, but at least you can access it. You just have to be careful about the format changing out from under you.

Related

How do you access content in a word document? (like Grammarly does)

I want to create a program that works like an autocomplete box for Microsoft Word. For that, I need some way of reading the contents of the page and getting the positions of words. I know that Microsoft has made a Javascript API for creating plugins in the form of side panes, but that's not what I'm after.
Grammarly manages to read the contents of the document and even underline specific words.
Maybe they have some agreement with Microsoft? Or could they be using some hacky solution? I did try to use win32api with both Python and C++ but didn't succeed.

Is there an easy way I can display a short message with the default Quick Look preview?

DRM-protected iTunes movie and music files show a fairly standard-looking Quick Look preview, but with an extra line of text added above the default material:
I'd like to be able to replicate this behavior for my DRM-protected custom document type, but so far I haven't found a way. Is there an easy way to achieve this and still keep the system-default content and layout? Sure, I could easily obtain all of the metadata and build my own preview, but then I'd have to worry about localizations and future-proofing.
No, the only way is to build a custom Quick Look preview extension and/or plugin.

How to compare the layout of pdf files programmatically?

It is possible to rip the text from pdf and comapre it. And here i need to compare if the layout of the pdf with another pdf file. Is it possible programmatically? There are third party tools to do that, but is it available for testing using selenium or any programming language?
I have gone through google, but couldn't find a solid solution for this yet? Any help appreciated.
With PDF Box of apache you should be among other things be able to extract the text from existing PDF documents.
ps: you probably have to create a custom program in jave to extract and compare and invoke it from selinium.

Programmatically Inserting Data into an InDesign Document

I have to use Adobe InDesign for creating documents. We basically need to have a couple variables throughout the document (company name, project name, etc) that need to be filled in.
I was wondering if there is a way to take an existing template and maybe programmatically fill these in using a language I'm comfortable with (Ruby, Python, etc). I have tried to open the Adobe InDesign file using a text editor - but when I make modifications using Notepad++ and then open the file in InDesign, it tells me the file is corrupted.
If you have any insight with programmatically building InDesign documents or know of any tutorials that would be much appreciated.
P.S. I tried to check out Adobe's ExtendScript but wasn't finding much documentation applying to InDesign.
Thanks for the help!
There is no (legal) way to do this in Ruby/Python. Theoretically it is possible to edit InDesign documents directly using any language but:
It's nowhere near as easy as just making some text modifications, you would have to figure out more about the format, and
It's in direct violation of the InDesign license agreement meaning you could face legal action if Adobe finds out.
ExtendScript is perfect for doing small things like this. If you open up ExtendScript Toolkit and set the target to InDesign you can browse and search the entire API easily. Doing search/replace for simple text variables is not hard at all.
An alternative would be exporting the documents to the .idml language which is easier and legal to edit outside of InDesign.
You can use the DataMerge-feature of Indesign --> https://helpx.adobe.com/indesign/using/data-merge.html
I think this is exactly what you are looking for.
Or you can use the Indesign API. Have a look at Extendscript-Toolkit especially the ObjectModell-Viewer.
You need to convert your .indd file to .idml and unzi it.
In /Stories/Story_*.idml you may found all text variables.
And no easy ways to change text variables in .indd without Adobe products.

Inject Open XML into an Open PowerPoint Presentation

I'm looking for a way to inject PresentationML and/or DrawingML into an open PowerPoint 2007/2010 presentation using the Open XML SDK or just System.IO.Packaging. There is an article on doing this with Word, but in that example it is using the Range.XML routine in Word's object model, which I cannot find an equivalant for in PowerPoint's object model.
The reason I'm looking to do this is if I have an item on it that the PowerPoint client does not support editing of but that Open XML does (and as a result, PowerPoint will display it). I want to set this myself via a managed-addin (VSTO) on the open presentation. An example would be the underline of text (not that I'm looking for this, but it is an example) - in PowerPoint, you cannot make the underline of text a picture <a:blip/>, but in Open XML you can.
Does anyone know how to do this?
I am using both OpenXML SDK 2 and the Object Model to process presentations.
What I do, simplistic as it sounds, is to save the presentation, close it, perform all the XML modifications I need using OpenXML SDK, and then load the presentation back and continue with the Object Model.
Nope, according to Microsoft support: http://www.ureader.com/msg/10972430.aspx

Resources