[SOLVED] Help Needed to Just Open a File

Hi.
I wrote a "simple" macro to just open a file on my iCloud Drive.
Name of the file is "?" + the name of the front application + ".rtf"
Example: "?Keyboard Maestro.rtf"

Here is my macro:

As result, I just obtained an error message:
Capture 2022-08-26 à 17.31.52

But the file exists ...
(the content of the variable seems to be ok)

I don't see where is my error.
I suppose it's trivial but ...
Could you please help me ?
Thanks a lot in advance.

Phil

What's that question mark doing just before the application name ?

It seems somehow unlikely that it would be part of the real file path.

Just a way to notify me that it's an "help" file
(a personal convention)

Looks like you've got a trailing Return in your variable (the little :leftwards_arrow_with_hook: symbol in the textual display at the bottom). Remove that and you should be good.

If you always want to open your RTFs in a certain application, you can choose that instead of "Finder" -- it's good practice to be explicit anyway, unless you want to use what you've set the file's "Open with..." in its "Get Info" box.

Also, unless you want to use it elsewhere in the macro, you don't need the "Appli" variable -- you can use the token directly in the "Open..." action and your macro can be a simple:

1 Like

Thanks for your reponse.
I see the :leftwards_arrow_with_hook: but I don't understand where it comes from ...
and I used the delete key to eliminate it, without success...
I also modified the open with Textedit as suggested.

That becomes more complicated: sometimes it works, sometimes not ...
And I dont see the difference :hot_face:

edit: in fact it works with some applications but not with all ???

I continue to obtain the message ... non-existent path ...

In the past, I tried to add a pause action between some steps but without success.
And the debugger don't give me a way to understand.

Fyi, the complete notification is:
Capture 2022-08-26 à 19.09.03

You typed it in the "Set Variable..." action's text field -- you've the line with your path, then a Return keystroke, then a blank line. Put the cursor in the field, down-arrow until it goes no lower, backspace until the cursor is just after the "f" of "rtf".

That might be a clue -- what applications does it work with, and which fail? Start with TextEdit -- I know that works here because I just tried it for a file called "?Keyboard Maestro.rtf" in a folder call "Notational Data MBA" in my iCloud folder.

Check your path very carefully -- easiest way is to go to the file you expect to open in the Finder then Control- or right-click it, hold down the Option key, select "Copy 'filename' as Pathname", and paste into a text editor, then compare that to what you have in KM.

1 Like

I'm testing the concerned applications ...
But now, it's time to ... eat :wink:

maybe an other clue:
in the beginning (Apple) Mail doesn't work...
And now, it's ok ...
Day One doesn't work since the beginning ...

now, after multiple trials, Day One is ok !
But I absolutely don't understand WHY !
It is very frustrating... :hot_face:

1 Like

As a note, sometimes iCloud removes the file locally and moves it online; that might be the reason why you get the “file not found” at the first time you run this flow, or in some instances when iCloud decides to again remove the local file.

1 Like

Thanks for the note
but as I don't choosed the option of 'optimize' iCloud Drive in the System pref's, I suppose that I'm not concerned ???

Optimize I think only applies to photos. I don’t know if there’s any iCloud settings.

Has the macro been working without issues?

Yes, now it seem's to be ok
(after some problems with Day One.app).
I don't understand... but its'ok :roll_eyes:

1 Like

Same problem again... but I have maybe a beginnng of explication !

I'm working with Devonthink (btw excellent software :+1: ).
When I create a new " ?... .rtf file " (example: "?Keyboard Maestro.rtf")
Devonthink names it "-Keyboard Maestro.rtf" :face_with_spiral_eyes:
And of course my KM macro does'nt find it !

I posted a question on the DVT forum. I'll be back with an eventual response...

Reponses from the DVT Forum:
(Problem with the name of a saved file - DEVONthink - DEVONtechnologies Community )

  • The phenomenon you are describing is caused by DEVONthink maximising the compatibility of the file name with the file system.

  • ? as !, ;, #, /, :, * and + are “special characters” for either the shell or the file/operating system. Just don’t use them in file names.

It's possible to bypass the control but it's not recommanded ... :slightly_frowning_face:

1 Like