Open n8gray opened 7 months ago
From Apple's point of view, the App and the extension are two different apps, with different permissions. The extension does not have access to the same folders as the app (and reciprocally). They have a few bookmarks in common (~iCloud
and ~shortcuts
/~group
), but that's it.
Thanks for the reply! The "Working Copy" app makes this work somehow. You can make shortcuts that operate on a repo in the LogSeq sandbox without bringing Working Copy to the foreground. I suspect there's a way to configure your entitlements so that the extension and the app share these acquired permissions. I'll do some research this weekend and see if I can find the info.
Thank you for pointing out that it was possible; I may have found out how to do it. I'm implementing it.
Awesome, great to hear it.
Hello again! Just curious - did you found a way to make this work?
Not for now. I'm back to "I have no idea how this could work".
How Working Copy does it?
@holzschu do you have any pointers to what you thought might be the 'trick'? I'd like to do some digging in the Apple documentation to see what might be possible
Apple documentation explicitly says that this is impossible. I have no idea how Anders Borum does it with WorkingCopy, and I think the only way to know would be to ask him directly.
@holzschu tnx - I first had to figure out what is exactly the Shortcut Item where this is used, but yes it indeed works in Working Copy (Pro Version):
/Test.md
which is in my On iPhone > Obsidian > Notes
directoryTest.md
fileSo somehow Andreas is able to make this work (which is nifty!) Let's see if we can ask him if he would be able to shed some light on he is able to get this to work! https://mastodon.nl/@mdbraber/112433500468179009 @palmin
Working Copy will run most of its Shortcuts actions from the main binary (while staying in the background) as the memory limits are a little relaxed compared to an intent extension. A side effect is that security scoped bookmarks made by the main app work.
I'm not 100% sure this is the whole story but I would try this as a first thing.
Thanks for thinking along @palmin! I have to get a bit acquainted with the code (and Intents API), but would this mean that NSExtensionPointIdentifier
would not be com.apple.intents-service
or NSExtensionPrincipalClass
has to be changed?
This video describes how to handle intents in the main app: https://developer.apple.com/wwdc20/10073
Thank you for the explanation, @palmin! If the Shortcuts actions are run from the main app, not the extension, that explains everything.
With my limited knowledge of building iOS apps, this does seem rather possible as most of the Intent logic is already there. It seems that handling intents can be simplified as we don't need to repeat code as is now done in e.g. IntentHandler
.
@holzschu what do you think? Would it be feasible to change from running apps in the extension to running from the main app?
I don't now how can't you do because may order coming department application az management thes all
With my limited knowledge of building iOS apps, this does seem rather possible as most of the Intent logic is already there. It seems that handling intents can be simplified as we don't need to repeat code as is now done in e.g.
IntentHandler
.@holzschu what do you think? Would it be feasible to change from running apps in the extension to running from the main app?
You already have the option to run Shortcuts "in app" instead of "in extension" (that's in the menu, and there's are three options: "default (use what you can)", "force in app", "force in extension"). The thing that is missing is the ability to run Shortcuts "in app but in the background". It seems technically feasible.
Absolutely right - I didn't make myself clear. I meant to ask if it's feasible to run Shortcuts "in app but in the background" as Anders mentioned. Would be great if this something which could be implemented.
Great to hear this is feasible! I think a lot of workflows could benefit from the ability to run in-app without bringing the app to foreground.
I've got it working in XCode / development - I'll clean up the code, test some more and submit a PR
The TestFlight version ( https://testflight.apple.com/join/REdHww5C ) had the PR by @mdbraber and offers the possibility to run Shortcuts commands "in the app but in the background", so you can access the bookmarks created by pickFolder (and also run Python packages and Python commands).
Thanks @palmin for the pointer in the right direction!
I’m trying to build a shortcut that will do some git operations in another app’s sandbox.
pickFolder
to create a bookmark to that folder calledLogSeq
.cd
to that folder and do the workThanks!