[SOLVED] Shortcut to get random line works on iPadOS but not iOS (17.5/17.5)

I have a shortcut that pulls a random quote from an .md file that stores quotes I would like to see. I have it working on my iPad, and Mac, but it seems to only pull the filename(no extension) on iOS. I am sure I’m not the only person that has ran into this, but alas, my googling has lead me to nothing.

Screenshot is build/output of my second Shortcut to test.

Original Shortcut:
File: path/to/quote.md > Split [file] by [New Lines] > Get [Random Item] from [Split text]

  • Works with macOS and iPadOS

Test Shortcut:
Get file from [directory path containing file] at path [quote.md] > …

any advice or workarounds you guys have found would be amazing!

SOLUTION - Turns out Delta Emulator was breaking my shortcut, again, only on iOS. I noticed on the quick look that the file was showing as a Genesis File pack, deleted Delta, and the shortcut runs just fine, will be reporting this to their dev team.

Special shoutout to @gluebyte for working on solutions with me. Truly, you were of great help through this.

UPDATE #2:

If you install ANY native emulator on iOS or iPadOS, it will currently (as of 2024-05-15) break the .md file handling. The exception I have found is iPhone emulated to iPad emulators (downloading Delta on the iPad pulls the iPhone app). Tested by downloading RetroArch to both iPhone and iPad, broke my .md file handling post install and app launch for both platforms.

You can try changing the type of the “File” variable in the “Split Text” action from “File” to “Text”, and making sure it’s getting the “Text” property not “Name”

Just tried that, I have changed [File] to text, Split text[File] to text, and I also tried get [Random Item] from [Split Text] as text, all with the same output shown in the screenshot above. I tried each step iteratively, and combined each type change on one go.

This is the output from iPadOS with it working, [File] is set to File, Get [Random Item] from [Split Text] is set to Text. (since I am new to the site I could only attach one embed)

Can you share the shortcut?

Here is the [Get File From Folder] flow:
https://www.icloud.com/shortcuts/e402e98a895b415aad087c7411ea34d1

Here is the [File} to split text flow:
https://www.icloud.com/shortcuts/0f322899914245eabdedec57e8436a62

I cannot fully test it since I don’t use Logseq. Can you check if this shortcut displays the file content twice correctly on your iPhone?
https://www.icloud.com/shortcuts/a6a7b0026c124566966ed091f02285a8

it does not:

Also, the file location/App doesn’t seem to matter in this case; I moved the file from my Logseq directory to my iCloud Drive, still has the same output no matter where the file is

Logseq agnostic shortcut:
https://www.icloud.com/shortcuts/92140beb5e284c8b8ab759fef80d9b74

Very weird. I’d suggest trying with a new text file using txt extension instead of md and creating a shortcut from scratch on the iPhone.

I cannot think of any other solution if it doesn’t work…:thinking:

1 Like

I just updated the post. Delta Emulator had defaulted itself to open .md files. Just deleted the app and retested and it works perfectly! Thank you for all the help on this!!

1 Like