we're developing an app that should be able to open specified file with default editor application. (so if it is .doc - it suppose to be opened by MSWord or openOffice)
But I also need to wait until user will close the editor, check if it was changed (by size and date), and upload it to the server.
So the following steps:
1) find def editor
2) open file
3) wait it be closed
4) do smth after that with the file.
now results of my research:
-> opening by def editor is simple: file.openWithDefaultApplication();
but there is no way to know that editor is closed (maybe by checking that file is not locked in timer???)
-> i can start the native process and pass file as parameter BUT looks like the code
NativeApplication.nativeApplication.getDefaultApplication(file.extension);
does not work for any extension :( - it doesnt work for "rtf", "doc" but works for "pdf"... and [file.openWithDefaultApplication()] works fine with any file!
any suggestions?
thx in advance!
but there is no way to know that
editor is closed
Correct. I do not believe what you want to do is possible with AIR. How would AIR be able to tell whether the file is open or not? You might want to look into using NativeProcess; but that would be reliant on the underlying OS/default program exposing APIs to let you know when the program was open and/or closed.
My only suggestion is that you don't have the Air application watch the file, but instead show a popup that say 'click okay when done editing file' and then upload it based on that.
The only other way I can think of this working is if you create both a .bat and a .sh file
(for both windows and macs/linux; select one or the other depending on the os) which open the file you want through NativeProcess (and of course, put 'wait') and then listen for the close event.
Related
I have a project that read Excel files and Custom extension files (.verify). It is working fine but more than expected.
I have used an Inno Setup 5 to be able to install my Java FX app in Windows and set up some file association.
Everything is ok but now, in the recent tab of the application in Windows, it shows every files i opened from the application like in the screenshoot:
my question is How to disable this feature from the javafx code? or at least check for some condition like if the file is an Excel or a Verify file because i dont want to implement an "Open Excel From Outside" behavior.
I've search the question title above on both Google and Stack Overflow before asking that question here but didn't find adequate result...
And for the code i tried, i can't try anything because i dont have any clue for where to start...
My guess was searching in the FileChooser class but there doesn't seem to be something about history in there.
Does this problem have a solution?
I would like to retrieve the welcome screen (and only it) when I start Atom. That way, I'll be able to choose the project I want to work on each time I start Atom (currently, I have to close the project opened the last time).
I already re-enabled the Welcome package in the init.coffee file so I see the welcome screen each time I start Atom, but there are two problems.
First: this screen is now shown every time I open a new window, so every time I open another project than the current one (I use Projects Manager if it matters). It's not very useful, as I only want to see this screen when I start Atom.
Second: I see the welcome screen on start, but only as new tabs in the last opened project, so the problem remains the same.
Has someone a solution?
The setting you are looking for is Settings > Open Empty Editor On Start, which is on the Core Settings page, right under Ignored Names. Make sure to enable this setting, i.e. check the box. Whenever you start Atom from its icon now, it will start with an empty editor, and will not reopen your previously used files.
I came across this problem, too.
But I found that if I had 'openEmptyEditorOnStart: true' in the config.cson file, and each time I quit the Atom I did "Remove Project Folder" in the "Tree View", next time I opened the Atom edit, I can open it without the last opened project.
Hope it helps. :)
Proper configuration to get empty editor on every start:
✔️ Open Empty Editor On Start
✖️ Restore Previous Windows On Start
Just go to File > Reopen Project > Clear Project History. It worked for me.
I just switched of package tree view
Setting/packages tree-view - disable
And when open Atom it is free of project tree
You need to do both in Core settings:
check Open Empty Editor On Start
set Restore Previous Windows On Start to no
so I've just begun using Visual Studio 2012 as a new programmer, and I'd like to find a way to have VS2012 automatically save (or at least automatically convert) files to UNIX line endings.
I found this page as a means of creating an executable that could be integrated with VS2010 as a macro. Since VS2012 no longer uses macros, how can I set this up so that this is executed on my files at save? I don't want to have to go to Advanced Save everytime I save a file (I tend to save every 30 seconds or so out of paranoia).
I began trying to construct an add in to handle this for me, but as a beginner I'm afraid that's a bit beyond me.
Thank you in advance for the help.
you can do like this,
click File, choose Save .... as, then in the save file dialog, choose save with Encoding, another dialog shows up, you can choose Unix format.
I'm trying to switch from Dreamweaver to a real IDE and trying Aptana as a likely candidate, however i'm stuck on how to get it's FTP to behave the way it did in DW.
Basically when I open a file in a project, it needs to automatically download from the FTP connection, before opening it.
The Deployment Settings > Automatically Sync in Both Direction doesn't seem to work, the only option of those 3 that works is "Sync from my machine to remote", which basically uploads the file on save - which is great, but I also need it to download when I open the file as well.
Am I missing something?
Currently Aptana Studio does not run file synchronization on it's opening, only on save.
There is a ticket for this feature which you could vote for.
Alternatively, you should be able to open, edit and save files directly from FTP connection.
I'm testing alivePDF 0.1.5 and till now everything's been fine.
I'm super interested in the new function writeFlashHTMLText() cause it makes my life so much easier! xD
I'm now trying to display the generated pdf in a browser tab/window instead of just saving the file (using the filereference class' save function). I saw that there was a PDF.save() function that allowed that specifying the argument Download.INLINE.
However I don't want to use the save function of the pdf class cause I don't want to use a script.
Is there any other way to achieve what I want?
Thanks a lot for your answers.
Regards,
BS_C3
Because of the way Flash works security-wise you have two options:
Generate and save the PDF to the local machine - this can be done entirely client-side using FlashPlayer 10+ (see the FileReference class).
The user can then navigate to, and launch, the generated PDF file.
Save the PDF to a server and link to the PDF from your Flash application. This will let you open the PDF in the browser.
Obviously this requires a server of some sort.
Build your app as an AIR application - this will let you save the file and, as far as I'm aware, launch it from the local machine.
The current state of things: you cannot generate a PDF and open it in the browser completely client-side (i.e. FlashPlayer in a browser) unless you are using AIR.