It sounds like the Notes were being saved on iCloud on both devices. When you deleted them from your phone, you were really deleting them from iCloud.
If you use "Time Machine" to backup your macbook, you can go back to the day before you deleted the notes on your phone and then sync your phone with iTunes to put the notes back on.
Then, on your iPhone, go into the iCloud settings and turn off Notes. This will save your iPhone notes locally and keep them separate from the macbook.
I just realised I have the same issue.
But using the new Dropbox feature to save app documents to your Dropbox.
What's New in Version 3.7 • New Action Extension for iOS 8: save files
straight to Dropbox from your favorite apps
I can now get all my iPhone notes over and into Notes.app on the Mac. Which has my icloud account as the default account
This Answer shows how to do it with Automator folder actions. As everyone should have that.
I will be using Hazel.app As I find that works better than Automator folder actions.
First on my Mac.
- create a folder in dropbox name notes.
- create a folder in my Macs documents folder named htmlNotes.
Create a Automator Folder Action workflow :
- Select the notes for the folder that receives the files.
- Add a Move finder Items action
- set the Move finder Items action's to: htmlNotes
- Add a Run Applescript action
- set the applescript code to:
on run {input, parameters}
set bodyText to (do shell script "cat " & quoted form of (POSIX path of (item 1 of input as string)))
set theName to paragraph 1 of (do shell script "cat " & quoted form of (POSIX path of (item 1 of input as string)) & " |textutil -format html -convert txt -stdin -stdout")
tell application "Notes"
activate
set theContainerFolder to container of first note
make new note at theContainerFolder with properties {body:bodyText, name:theName}
end tell
end run
Save it.
Now in the Notes app on the iPhone I have the latest Dropbox update which gives me the ability to save a note to dropbox using the share icon.
(If you cannot see the Dropbox extension in your share list. the click the More button and activate it.)
Once you are in Dropbox , choose the folder you want the files to be saved into.
Dropbox will remember you last selection.
Lastly save the file.
The script should run on the make and move the file from notes to htmlNotes.
I did this moving because I originally found that if Dropbox did any updates to the folder the files would be added more than once to notes.
The files saved into dropbox are formatted in html tags. This is really handy because it allows us to keep most of the formatting from the original notes. The reason I do the conversion from html to text in the script is just to cleanly get the first paragraph, which will be used for the notes name.
Hope this helps. And note that this can be adapted to be used with any other way you choose to get the note text file onto your Mac, i.e email rule, Script Editor.app or like me Hazel as I find it is more responsive than the built in folder actions.
Here is the adapted script for Hazel:
set bodyText to (do shell script "cat " & quoted form of (POSIX path of theFile))
set theName to paragraph 1 of (do shell script "cat " & quoted form of (POSIX path of theFile) & " |textutil -format html -convert txt -stdin -stdout")
tell application "Notes"
activate
set theContainerFolder to container of first note
make new note at theContainerFolder with properties {body:bodyText, name:theName}
end tell
Best Answer
I was able recover all the files i lost. Lucky enough.
You can follow following steps to achieve it.
Following used:
1. mac_apt
2. DB browser for sqlite
Using mac_apt, i connected to database command below on terminal ./mac_apt_singleplugin.app/Contents/MacOS/mac_apt_singleplugin -i ~/Library/Group\ Containers/group.com.apple.notes/NoteStore.sqlite -o ~/Desktop/Note/mactool/ NOTES
This will create a Notes.csv in our output folder provided. It will have all the notes present.
Open the CSV, You will see your note text in the column 'Data'. For me, the 'Data' didn't had complete text present, but was partial. To get entire note file i filtered on the 'Folder' (as i lost one specific folder data) and got 'ID' column.
I connected to NoteStore.sqlite database using DB browser for sqlite
SELECT * from ZICNOTEDATA where ZNOTE='ID';
Click on each ZDATA entry and on the right side click 'Export'