Apple's vision for iCloud seems to include isolating users from the confusion of the file system. iCloud files are accessed from within the application that created them–which is advantageous in some situations and a problem in others.
To use iCloud to share documents between iOS and MacOS you'll need to install iA Writer on both platforms. (Byword fans can now do the same).
If you want to use a different text editor, or editors, on your Mac, implement my (previous?–my test of the Byword iCloud setup is working well so far) workflow that included a storage system using DropBox.
I can't recommend this path because I haven't fully explored it, and it isn't officially supported by Apple, but if you're determined to create file aliases on the desktop, you might find a solution by exploring the folder ~/Library/Mobile Documents
↬Kirk McElhearn: Make your own personal dropbox with iCloud
Note that on the Mac I'm writing this from, the folder for my Byword documents did not exist within the Mobile Documents folder until I used the Open from iCloud… menu item. (I didn't have to load a file, just access the menu and allow the file requestor box a minute to populate.) Once the Byword folder existed, I was able to create an alias on the desktop that opens the file. I can also use the alias to Open with… TextMate but have not tested editing/saving the file using an alternative application Proceed with caution.
I've tried numerous times to reproduce the issue, however I couldn't. So this solution was tested by manually entering a standard URL twice, via copy and paste, and going from there. I also used the bad URL you've shown in your question.
In Safari, this essentially tries to build a valid URL from of the double URL using AppleScript run as an Automator Service when pressing ⌘B and sets the current document (window, tab) to the proper URL.
Create an Automator Service with the settings as shown in the image below and save it as:
Fix Bad URL
Then in System Preferences > Keyboard > Shortcuts > Services, scroll down to General, select
Fix Bad URL, click Add Shortcut and type: ⌘B
AppleScript code for the Automator Service:
on badURL()
try
-- # Put the bad URL on the Clipboard.
tell application "Safari"
activate
delay 0.5
tell application "System Events"
key code 37 using {command down} # ⌘L
delay 0.5
key code 8 using {command down} # ⌘C
delay 0.5
end tell
end tell
-- # Retrieve the bad URL from the Clipboard.
set theBadURL to get (the clipboard)
-- # Trim the first eight characters off of 'theBadURL'.
-- # This is done because the bad URL can have an occurrence of both 'http' and 'https' in the string in either
-- # order and by trimming off, it lessens the amount of logic necessary to build a good URL from the bad URL.
-- # The good URL, after all, is going to be built from what's after the second occurrence of either one.
-- # Test first for 'https' then 'http', as that makes more sense logically to do so.
set theBadURL to do shell script "awk 'BEGIN { print substr(\"" & theBadURL & "\", 9) }'"
-- # Build the good URL from the bad URL.
set theGoodURL to do shell script "awk -F 'https.*//' '{print $2}'<<<" & quoted form of theBadURL
if theGoodURL is not equal to "" then
set theGoodURL to "https://" & theGoodURL
else
set theGoodURL to do shell script "awk -F 'http.*//' '{print $2}'<<<" & quoted form of theBadURL
if theGoodURL is not equal to "" then
set theGoodURL to "http://" & theGoodURL
end if
end if
return theGoodURL
on error eStr number eNum
display dialog eStr & " number " & eNum buttons {"OK"} default button 1 with icon caution
return
end try
end badURL
on run
try
tell application "Safari"
activate
set thisTabsURL to (get URL of current tab of window 1)
-- # Check for bad URL and if found, build a good URL from it.
tell current application
if thisTabsURL contains "file:" then
set theGoodURL to my badURL()
tell application "Safari" to set the URL of the front document to theGoodURL
end if
end tell
end tell
on error eStr number eNum
display dialog eStr & " number " & eNum buttons {"OK"} default button 1 with icon caution
return
end try
end run
Note that while I tested this under OS X 10.8.5 and macOS 10.12 and it did work under my test conditions, nonetheless it may not work properly every time under every condition and hence why the try
and on error
statements are being used in the code. Hopefully this will trap any error(s) with appropriate output to then enhance the code to handle any error(s) that didn't occur during my testing.
Best Answer
You're doing good except for the last line where you will have to share the link with someone.
Share the link with yourself.
Choose imessages as the sharing option and enter your email or number. And add yourself.
To check the validity, This is a .Pages file and please try to access it and tell me if you can open and edit it or not.
Since this requires sign-in, I don't think you will be allowed to edit or even view it.
Only bad thing is the file name is in the URL