How to change/suppress the file already exists message in NSSavePanel? - swift

I use an NSSavePanel to ask users to indicate the file to which they want to save some information. If they choose an existing file I'd simply append the new information to the end. The issue is that OS X would give the following message:
“new-file.txt” already exists. Do you want to replace it?
And I can't find a way to change this message. Is there a way to do this?

Related

KDB generating ERROR:file/path/location/sym os reports: No such file or directory

I am trying to save table as partition using .Q.dpt[hdbroot;.z.d;`tablename].
But it's generating No such file or directory error, but the directory is present.
can you please help me on this.
I have created blank folder to store the data but it's checking for sym file while storing data.
I have created one blank folder and gave that folder path to hdbroot variable, but it's not working.
I could replicate your error by trying to save to a location that doesn't exist on the machine.
q).Q.dpt[`:/does/not/exist;.z.d;`t]
'/does/not/exist/sym. OS reports: No such file or directory
[0] .Q.dpt[`:/does/not/exist;.z.d;`t]
Like I mentioned in my comment, make sure that the hdbroot variable is exactly the location you're expecting. key can help you determine this, here is a quick helper function for you.
q)exists:{"Folder/file ",$[11=abs type key x;"exists";"does not exist"]}
q)exists`:/does/not/exist
"Folder/file does not exist"
q)exists`:/tmp
"Folder/file exists"

How can i get the current log file name on runtime from tinylog

i am using tinylog 2 and i want to load the current log file content to show it in my gui.
My tinylog.properties looks something like this:
writer=rolling file
writer.file=project_{date: yyyy-MM-dd}.log
So my problem is: How can i get the current filename of the logger file ?
i can resolve it with hard coded java String formatter, but when someone change the properties file it doesn't fit.
Is there a way to get the current resolved logfile name from Tinylog?
Thanks
tinylog 2 does not provide any specific API for receiving the file name. However, feel free to file a feature request on GitHub. As the main contributor of tinylog, I could imagine to implement such feature for tinylog 2 or 3. Especially, I'm thinking about a listener that could automatically inform you about a rollover event and provide the new file name.

Automatically download emails from Outlook with SAS or Outlook rule

I am trying to create a program to automatically download the attached files that are sent to us from a certain email and then transform the delimiter with SAS, of those csv that are attached to us and pass those csv through a flow that I have already created.
I have managed to create a program that treats the csv as I want and the delimiter that I want, the problem is that when it comes to automating the download of files from Outlook it does not work.
What I have done is create a rule with the following VB code that I found on the internet:
Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "C:\Users\ES010246\Desktop"
For Each oAttachment In MItem.Attachments
oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
Next
End Sub
I have changed the path to my personal path where i want the files are downloaded.
website: https://es.extendoffice.com/documents/outlook/3747-outlook
The problem is that this code does not work for me, it does absolutely nothing for me and no matter how much I search the internet, only this code appears.
Is there any other way to do with SAS what I want? What is it to automatically download 8 csv files sent to me by Outlook, or has someone experienced the same thing as me with VBA?
I have followed all the steps about 7 times so I think the error is not in copying the code or selecting certain options wrong, in fact I had copied and pasted the code and later I modified the path where I wanted those to be saved. files but it doesn't work, does anyone know why?
I will be tremendously grateful, thank you very much for everything!
First of all, you need to make sure the file name and path doesn't include forbidden symbols.
The VBA macro used for a rule in Outlook is absolutely valid except that a mail item may contain the attached files with the same name, so a file saved to the disk may be overwritten (saved with the same name). That's why I'd suggest generating a file name with your own unique IDs making sure that DisplayName property is not empty and has a valid name what can be used for file names (exclude forbidden symbols).
Also you may consider handling the NewMailEx event of the Application class which is fired when a new message arrives in the Inbox and before client rule processing occurs. Use the Entry ID returned in the EntryIDCollection string to call the NameSpace.GetItemFromID method and process the item. This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem.
The Items.ItemAdd event can be helpful when items are moved to a folder (from Inbox). This event does not run when a large number of items are added to the folder at once.

Why would LayoutObjectNames return an empty string in FileMaker 14?

I'm seeing some very strange behavior with FileMaker 14. I'm using LayoutObjectNames for some required functionality. On the development system it's working fine. It returns the list of named objects on the layout.
I close the file, zip it up and send it to the client, and that required functionality isn't working. He sends the file back and I open it and get a data viewer up. The function returns nothing. I go into layout mode and confirm that there are named objects on the layout.
The first time this happened and I tried recovering the file. In the recovered file it worked, so I assumed some corruption had happened on his end. I told him to trash the file I had given him and work with a new version I supplied. The problem came up again.
This morning he sent me the oldest version that the problem manifested in. I confirmed the problem, tried recovering it again, but this time it didn't fix the problem.
I'm at a loss. It works in the version I send him, doesn't on his system. We're both using FileMaker 14, although I'm using Advanced. My next step will be to work from a served file instead of a local one, but I have never seen this type of behavior in FileMaker. Has anyone seen anything similar? Any ideas on a fix? I'm almost ready to just scrap the file and build it again from scratch since we're not too far into the project.
Thanks, Chuck
There is a known issue with the Get (FileName) function when the file name contains dots (other that the one before the extension). I will amend my answer later with more details and a possible solution (I have to look it up).
Here's a quote from 2008:
This is a known issue. It affects not only the ValueListItems()
function, but any function that requires the file name. The solution
is to include the file extension explicitly in the file name. This
works even if you use Get (FileName) to return the file name
dynamically:
ValueListItems ( Get ( FileName ) & ".fp7" ; "MyValueList" )
Of course, this is not required if you take care not to use period
when naming your files.
http://fmforums.com/forums/topic/60368-fm-bug-with-valuelistitems-function/?do=findComment&comment=285448
Apparently the issue is still with us - I wonder if the solution is still the same (I cannot test this at the moment).

Allow for non-existent files in FileFieldEditor [duplicate]

I'm setting up a series of preferences in my Eclipse (3.5.2) application and I'm having a problem with the FileFieldEditor. I want to allow the user to specify a log file to print output to. Often, this will be a new file. But when I use the file select dialog with FileFieldEditor, it complains that the file doesn't exists ("Value must be an existing file"). Is there a way, without extending the FileFieldEditor class, to suppress this error and have Java create that file if it doesn't exist? Thanks!
When I look the source code of org.eclipse.jface.preference.FileFieldEditor, the only solution would be to extend it and write your own version of a FileFieldEditor, with:
an overwritten changePressed() method in order to keep the file path even if the file does not exists
an overwritten checkState() method in order to avoid that error message.
So I do not see a way to avoid that FileFieldEditor extension here.