adobe acrobat actions or batch processing - js get paths of all files in a folder - batch-processing

So I would like to create an action that will take a folder, and display/store its contents filenames (as I would later want to manipulate the files on this folder via their filenames). I believe this is achieved via javascript.
I did the ff:
create new action
-> starts with -> A Folder on my Computer
I have no idea what to do next.
Any help would be awesome.
Thanks

A document's path can be accessed via this.path, the file name can be accessed via this.documentFileName. If all you want is a list of paths, you could print them to the console via console.println(this.path);.
There are likely better methods to achieve your objective than via Acrobat's batch processes, but without more detail, it's hard to point you in a direction.

Related

Vaadin 8 multiupload with folder selection

I need to upload files and folders to the server while preserving the hierarchy. At the moment I am using a plugin multiFileUpload that allows you to upload multiple files at the same time, but it ignores the selected folders. I know that neither vaadin nor Html5 has a universal solution that works everywhere for uploading folders.
I'm ready to write my own solution, but climbed the Internet can't find a way to display file selection (perhaps there will a JavaScript call) but the main question - is it possible somehow to POST a request Vaadin's and upload files by way of creating subfolders in which they were?
You can only upload files, not folders. It's simply not doable.
You can upload any number of files, but they won't be structured into folders.
I see two possibilities how you could still achieve what you need if you really wanted to, even if it changes the user experience a bit:
Let the user upload a .zip file of his folder structure. When they upload it, you unzip it on the server side and have now access to all the files in the correct folder structure.
Let the user upload all his files within his folder structure. After all files have been uploaded, You display all the files in a TreeGrid where the user can recreate the original structure using Drag-and-Drop or similar.

custom file open with custom application only

I am working on vb.net application where I wanted to create and read a file. File will have specific extension for ex. .abcb the way I want my application to work is:
can create a file with .abcd extension
should read .abcd files only(and also application created files only so altered extension shouldn't be working)
.abcd files should show some garbage data when open in any other application(ex. word, notepad any image viewer etc.)
Now my application does 1,2(partly) step, i.e. it creates a file and load data also, it reads .abcd files only(not the altered files)
but created file can be read by other software's also.I tried searching a lot but have not found anything and don't know where to start.
Any help is appreciated!
if you don't want other programs to be able to read the content of your file then your going to have to mask it in some way, which is usually done with encryption.
assuming your not too worried about the key being compromised, the easiest way to accomplish this would be to generate a key with something like System.Security.Cryptography and use that key to encyrpt everything you send to the file and everything you read from it.
as for making your own file extension, you can make the extension of a file whatever you want when you make it:
Dim fs As FileStream = File.Create("/path/to/file/filename" & ".abcd")
the only thing that the extension does is tell the OS what progam to use when opening a file by default, which will probably be notepad since your making your own extension

Can DM script read images with the same extension (like *.mrc) from a folder?

I have a bunch of MRC images saved in a folder. I want my DM script to read and process them one by one. Now I just open some of them (like 20 images) at once and use FindNextImage in my script to sequentially process them.
I am wondering if I can define a path and let DM script go to this path to read out the MRC images one by one.
The best way to do this is with the function GetFilesInDirectory. An example of its use was posted with the answer to the following question:
Opening multiple files from folder ...
An example of how to extract the files with a particular file type extension was given in the answer to this question:
How could I open more than one image ...
In particular, have a close look at the method CreateFilteredFileList.

Loading text files from any location in Objective C

I haven't been able to make the application load a file except by putting a direct link to the file hard-coded into the application or putting the file into the same part of the file system as the program.
I am using the console interface for this application, and I just need it to ask the user what file to load, let them tell the program which file to use, then execute the rest of the code and return the results. Putting a direct link and putting the file in the same directory works, but this solution is useless because I need to be able to select various files from anywhere on the computer. Thanks for any advice.

Recommended document structure. File Wrappers? Roll my own?

I'm currently working out the best structure for a document I'm trying to create. The document is basically a core data document that uses sqlite as its store, but uses the Apple provided NSPersistentDocument+FileWrapperSupport to enable file wrapper support.
The document makes heavy use of media, such as images, videos, audio files, etc. with potentially 1000s of files. So what I'm trying to do is create a structure similar to the following:
/myfile.ext/
/myfile.ext/store.sqlite
/myfile.ext/content/
/myfile.ext/content/images/*
/myfile.ext/content/videos/*
/myfile.ext/content/audio/*
Now, first of all I went down the route of creating a temporary directory and placing all of my media in there. Basically creating the paths and file names '/content/images/image1.jpg' as I wanted them to appear in the saved file wrapper, and then upon save I attempted to copy these all into the filewrapper...
What I found was that the files were indeed copied into the wrapper with the file structure I wanted, but when the actual wrapper was saved, these files all magically disappeared.
Great.
So, I trashed my existing solution and tried to use file wrappers instead. This solution involved creating a content wrapper file directory when a new document was created, or loading in a content directory file wrapper upon opening a document.
When an image was added/modified, I created the necessary directory wrappers inside this root content wrapper (i.e. an images directory wrapper if it didn't already exist, or any other intermediary directory wrappers that needed to be created) and then created a regular file wrapper for the media, removing any existing wrapper for that file name if one was there.
Saving the document was just a case of making sure the content file wrapper was added to the document file wrapper, and the document would save.
Well... it did. The first time. However, any attempts to make any subsequent changes i.e add an image, save. Then replace image, save. Did not behave as expected, only showing the image from the first save.
So, my question is... first of all, which of the above approaches is the correct one, if at all, and what am I doing that wrong for them to fail.
And secondly, as I expect to be managing 1000s of images, is using file wrappers the correct way to go about things at all.
With that much media in play, you should likely give your users control over whether the media resides in the document or only a reference to the media is included in the document, and the media resides elsewhere, such as in a library/repository managed by your application. Then they could save out a (potentially many times larger) copy with all references resolved.
You might want to zip/unzip any directory so that users don't get confused trying to attach the document to an email. I believe iWork has been doing this with its document bundles for a while now.
As far as what you are doing wrong, no-one can say, as you haven't provided any code demonstrating what you are doing.
Why don't you create a one-off application that lets you select files on disk and saves those files in a document using a file wrapper? This would let you tackle this functionality without any interference from other issues in your application. Once you understand how to use file wrappers, you can port the code back or just write new code that works.