Skip to content

Commit

Permalink
get attachment mote id
Browse files Browse the repository at this point in the history
  • Loading branch information
miyako committed May 1, 2024
1 parent dc0a3ef commit ccbf3d0
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 34 deletions.
9 changes: 4 additions & 5 deletions Notes/4DPlugin-Notes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,20 +721,19 @@ PA_CollectionRef getAttachments()
SBElementArray *attachments = [application attachments];
NSArray *attachmentNames = [attachments arrayByApplyingSelector:@selector(name)];
NSArray *attachmentIds = [attachments arrayByApplyingSelector:@selector(id)];
NSArray *attachmentNotes = [attachments arrayByApplyingSelector:@selector(container)];

for(NSUInteger i = 0; i < [attachments count]; ++i)
{
PA_ObjectRef item = PA_CreateObject();

NSString *attachmentName = [attachmentNames objectAtIndex:i];
NSString *attachmentId = [attachmentIds objectAtIndex:i];
NotesNote *note = [attachmentNotes objectAtIndex:i];

ob_set_s(item, L"name", [attachmentName UTF8String]);
ob_set_s(item, L"id", [attachmentId UTF8String]);

NotesAttachment *attachment = [attachments objectAtIndex:i];

ob_set_s(item, L"note", [attachment.id UTF8String]);
ob_set_s(item, L"id", [attachmentId UTF8String]); NotesNote *note = [attachmentNotes objectAtIndex:i];
ob_set_s(item, L"note", [note.id UTF8String]);

PA_Variable v = PA_CreateVariable(eVK_Object);
PA_SetObjectVariable(&v, item);
Expand Down
2 changes: 1 addition & 1 deletion Notes/English.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/* Localized versions of Info.plist keys */CFBundleName = "Notes";CFBundleShortVersionString = "4.1.0";CFBundleGetInfoString = "Notes version 4.1.0, Copyright 2024 miyako.";
/* Localized versions of Info.plist keys */CFBundleName = "Notes";CFBundleShortVersionString = "4.1.1";CFBundleGetInfoString = "Notes version 4.1.1, Copyright 2024 miyako.";
Expand Down
Binary file modified Notes/Notes.dmg
Binary file not shown.
6 changes: 3 additions & 3 deletions Notes/Notes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
"$(PROJECT_DIR)/a",
);
LIBRARY_STYLE = Bundle;
MARKETING_VERSION = 4.1.0;
MARKETING_VERSION = 4.1.1;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
Expand Down Expand Up @@ -417,7 +417,7 @@
"$(PROJECT_DIR)/a",
);
LIBRARY_STYLE = Bundle;
MARKETING_VERSION = 4.1.0;
MARKETING_VERSION = 4.1.1;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
Expand Down Expand Up @@ -466,7 +466,7 @@
"$(PROJECT_DIR)/a",
);
LIBRARY_STYLE = Bundle;
MARKETING_VERSION = 4.1.0;
MARKETING_VERSION = 4.1.1;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<VariablesViewState
version = "1.0">
<ContextStates>
<ContextState
contextName = "Notes::getAttachments():4DPlugin-Notes.cpp">
<PersistentStrings>
<PersistentString
value = "attachment.container">
</PersistentString>
</PersistentStrings>
</ContextState>
</ContextStates>
</VariablesViewState>
Binary file modified Notes/Notes.zip
Binary file not shown.
Binary file modified Notes/test/Data/data.4DD
Binary file not shown.
Binary file modified Notes/test/Data/data.journal
Binary file not shown.
2 changes: 1 addition & 1 deletion Notes/test/Plugins/Notes.bundle/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>4.1.0</string>
<string>4.1.1</string>
<key>CFBundleSignature</key>
<string>4D06</string>
<key>CFBundleSupportedPlatforms</key>
Expand Down
Binary file modified Notes/test/Plugins/Notes.bundle/Contents/MacOS/Notes
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<dict>
<key>hash</key>
<data>
JR6ZAEuSOV7PoYqFW4YLw0IE5sA=
CWfQahjverPgAvWkAKQ/ZNS4LEc=
</data>
<key>optional</key>
<true/>
Expand All @@ -35,7 +35,7 @@
<dict>
<key>hash2</key>
<data>
URQpJBu2TVXHP7Kto8lWYUAreMkAhkQxLhm3Fp96+3M=
NGyyO60+yobasHj0Q9xR5/Y5s4ogtiNk+wtZA5pO+ko=
</data>
<key>optional</key>
<true/>
Expand Down
2 changes: 1 addition & 1 deletion Notes/test/Project/DerivedData/methodAttributes.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"timeStamp": "2024-04-26T07:03:26Z"
},
"TEST_notes": {
"timeStamp": "2024-05-01T04:55:06Z"
"timeStamp": "2024-05-01T04:59:55Z"
}
}
}
65 changes: 44 additions & 21 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ attachments|COLLECTION|collection of `attachment`
{
"name": "image.png",
"id": "x-coredata://5E8616AB-4594-4644-8F88-CE7880A4E33D/ICAttachment/p23",
"note": "x-coredata://5E8616AB-4594-4644-8F88-CE7880A4E33D/ICAttachment/p23"
"note": "x-coredata://5E8616AB-4594-4644-8F88-CE7880A4E33D/ICNote/p15"
}
]
```
Expand All @@ -155,6 +155,49 @@ name|TEXT|
id|TEXT|`x-coredata`
note|COLLECTION|`x-coredata`

```4d
note:=Notes Get note (id)
```

メモに登録されているメモの情報をオブジェクト型で返します。

Parameter|Type|Description
------------|------------|----
id|TEXT|
note|OBJECT|


```json
{
"id": "x-coredata://5E8616AB-4594-4644-8F88-CE7880A4E33D/ICNote/p15",
"folder": "x-coredata://5E8616AB-4594-4644-8F88-CE7880A4E33D/ICFolder/p10",
"name": "ううう",
"body": "<div>ううう</div>\n",
"creationDate": "2019-08-07T10:42:31Z",
"modificationDate": "2019-08-07T19:50:27Z",
"creationLocalDate": "2019-08-07T19:42:31",
"modificationLocalDate": "2019-08-08T04:50:27",
"attachments": []
}
```

Properties of ``note``:

Parameter|Type|Description
------------|------------|----
id|TEXT|`x-coredata`
folder|TEXT|`x-coredata`
name|TEXT|
body|TEXT|
creationDate|TEXT|
modificationDate|TEXT|
creationLocalDate|TEXT|
modificationLocalDate|TEXT|
attachments|COLLECTION|collection of `x-coredata`






Expand Down Expand Up @@ -219,26 +262,6 @@ path|TEXT|

**Note**: This methods call ``sqlite3`` to resolve the attachment path.

```
note:=Notes Get note (id)
```

Parameter|Type|Description
------------|------------|----
id|TEXT|
note|OBJECT|

Properties of ``note``:

* ``id``:``string``
* ``name``:``string``
* ``body``:``string``
* ``folder``:``string`` (id)
* ``creationDate``:``string``
* ``creationLocalDate``:``string``
* ``modificationDate``:``string``
* ``modificationLocalDate``:``string``
* ``attachments``:``array`` of ``string`` (id)

```
folder:=Notes Get folder (id)
Expand Down

0 comments on commit ccbf3d0

Please sign in to comment.