Jump to content

Starting with ”Alfred-workflow-save-ur-note” - setting the the keyword


Recommended Posts

Hey and good day,
 

So the user needs first to create an empty .txt file, done.

 

then  add "keyword … to use to create a quick note" - how to that, it's not a trigger, and where to set it.

because "qn" is for *adding* a quick note, not for creating one?!


 

image.jpeg.959c7ce045582c1f0277ba628aae103c.jpeg
 

 

(Slightly confused)

okn

Link to comment
10 hours ago, Vero said:

 

 

2 Questions please:

 

1.

qn is to create a new QuickNote each time, but is it possible to add a line of text to the existing QuickNote.txt file?

 

 ⇢ Even better would be to add the new line of text at top of the file, so newest is at top.
 

2.

Where to set the date so that it is correct?

 

 

/

with best regards,

Omar KN, Stockholm, Sweden

Screenshot 2024-01-17 at 22.32.03.jpg

Edited by OmarKN
Link to comment

Sorry that I didn't understand you were already using my workflow. Your screenshot didn't look like my workflow so I did not realise it was!

 

7 hours ago, OmarKN said:

qn is to create a new QuickNote each time, but is it possible to add a line of text to the existing QuickNote.txt file?

When you use qn any time after the first time (with a new notes file) the note is automatically added to the file. In other words the new note (or line of text) is appended to the file. Is that what you mean in your question? Alternatively, do you want to amend or add to a previous quick note you've already made (which the workflow is not designed to do)?

 

7 hours ago, OmarKN said:

Where to set the date so that it is correct?

What you are seeing are simply dynamic placeholders for the date and time which should thus automatically expand and I don't understand why they are not expanding for you to show the date and time the quick note is added.

 

Please open the debugger, run the workflow and copy and paste the complete output of the debugger in this thread.

 

Stephen

Link to comment
6 hours ago, Stephen_C said:

Hey and good day Stephen,

Here is the logg:

 

The 'Trim Line Whitespace', was this my choice or?

 

[12:41:40.551] Logging Started...

[12:42:25.835] Save 'ur note[Keyword] Processing complete

[12:42:25.839] Save 'ur note[Keyword] Passing output 'text4' to Automation Task

[12:42:25.842] Save 'ur note[Automation Task] Running task 'Trim Line Whitespace' with arguments (

    text4

)

[12:42:25.910] Save 'ur note[Automation Task] Processing complete

[12:42:25.913] Save 'ur note[Automation Task] Passing output 'text4' to Arg and Vars

[12:42:25.914] Save 'ur note[Arg and Vars] Processing complete

[12:42:25.914] Save 'ur note[Arg and Vars] Passing output 'text4' to Automation Task

[12:42:25.915] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (

    text4

)

[12:42:25.920] Save 'ur note[Automation Task] Processing complete

[12:42:25.921] Save 'ur note[Automation Task] Passing output 'false' to Conditional

[12:42:25.922] Save 'ur note[Conditional] Processing complete

[12:42:25.922] Save 'ur note[Conditional] Passing output 'false' to Write Text File

[12:42:25.928] Save 'ur note[Write Text File] Processing complete

[12:42:25.929] Save 'ur note[Write Text File] Passing output '/Users/okn/Documents/Quick Notes/QuickNote.txt' to Post Notification

[12:43:58.521] Save 'ur note[Keyword] Processing complete

[12:43:58.534] Save 'ur note[Keyword] Passing output '' to Arg and Vars

[12:43:58.535] Save 'ur note[Arg and Vars] Processing complete

[12:43:58.536] Save 'ur note[Arg and Vars] Passing output '' to Automation Task

[12:43:58.536] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (

    ""

)

[12:43:58.537] Save 'ur note[Automation Task] Processing complete

[12:43:58.538] Save 'ur note[Automation Task] Passing output 'true' to Conditional

[12:43:58.538] Save 'ur note[Conditional] Processing complete

[12:43:58.539] Save 'ur note[Conditional] Passing output 'true' to Run Script

[12:45:37.919] Save 'ur note[Keyword] Processing complete

[12:45:37.921] Save 'ur note[Keyword] Passing output ' text5, was it added to text4?' to Automation Task

[12:45:37.931] Save 'ur note[Automation Task] Running task 'Trim Line Whitespace' with arguments (

    " text5, was it added to text4?"

)

[12:45:37.971] Save 'ur note[Automation Task] Processing complete

[12:45:37.984] Save 'ur note[Automation Task] Passing output 'text5, was it added to text4?' to Arg and Vars

[12:45:37.985] Save 'ur note[Arg and Vars] Processing complete

[12:45:37.987] Save 'ur note[Arg and Vars] Passing output 'text5, was it added to text4?' to Automation Task

[12:45:37.988] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (

    "text5, was it added to text4?"

)

[12:45:37.989] Save 'ur note[Automation Task] Processing complete

[12:45:37.989] Save 'ur note[Automation Task] Passing output 'false' to Conditional

[12:45:37.990] Save 'ur note[Conditional] Processing complete

[12:45:37.991] Save 'ur note[Conditional] Passing output 'false' to Write Text File

[12:45:37.991] Save 'ur note[Write Text File] Processing complete

[12:45:37.992] Save 'ur note[Write Text File] Passing output '/Users/okn/Documents/Quick Notes/QuickNote.txt' to Post Notification

[12:46:07.942] Save 'ur note[Keyword] Processing complete

[12:46:07.944] Save 'ur note[Keyword] Passing output '' to Arg and Vars

[12:46:07.944] Save 'ur note[Arg and Vars] Processing complete

[12:46:07.945] Save 'ur note[Arg and Vars] Passing output '' to Automation Task

[12:46:07.961] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (

    ""

)

[12:46:07.962] Save 'ur note[Automation Task] Processing complete

[12:46:07.963] Save 'ur note[Automation Task] Passing output 'true' to Conditional

[12:46:07.963] Save 'ur note[Conditional] Processing complete

[12:46:07.964] Save 'ur note[Conditional] Passing output 'true' to Run Script

[12:52:19.068] Save 'ur note[Keyword] Processing complete

[12:52:19.088] Save 'ur note[Keyword] Passing output 'text6, QN has now TEdit as default app.' to Automation Task

[12:52:19.089] Save 'ur note[Automation Task] Running task 'Trim Line Whitespace' with arguments (

    "text6, QN has now TEdit as default app."

)

[12:52:19.121] Save 'ur note[Automation Task] Processing complete

[12:52:19.123] Save 'ur note[Automation Task] Passing output 'text6, QN has now TEdit as default app.' to Arg and Vars

[12:52:19.124] Save 'ur note[Arg and Vars] Processing complete

[12:52:19.124] Save 'ur note[Arg and Vars] Passing output 'text6, QN has now TEdit as default app.' to Automation Task

[12:52:19.125] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (

    "text6, QN has now TEdit as default app."

)

[12:52:19.126] Save 'ur note[Automation Task] Processing complete

[12:52:19.126] Save 'ur note[Automation Task] Passing output 'false' to Conditional

[12:52:19.127] Save 'ur note[Conditional] Processing complete

[12:52:19.128] Save 'ur note[Conditional] Passing output 'false' to Write Text File

[12:52:19.128] Save 'ur note[Write Text File] Processing complete

[12:52:19.129] Save 'ur note[Write Text File] Passing output '/Users/okn/Documents/Quick Notes/QuickNote.txt' to Post Notification

[12:52:36.588] Save 'ur note[Keyword] Processing complete

[12:52:36.609] Save 'ur note[Keyword] Passing output '' to Automation Task

[12:52:36.610] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (

    ""

)

[12:52:36.611] Save 'ur note[Automation Task] Processing complete

[12:52:36.611] Save 'ur note[Automation Task] Passing output 'true' to Conditional

[12:52:36.612] Save 'ur note[Conditional] Processing complete

[12:52:36.612] Save 'ur note[Conditional] Passing output 'true' to Open File

[12:53:22.925] Logging Stopped.

 

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 

A while later I set after Prompt for note text: Date Manipulation > Current Time

 

[12:56:26.707] Logging Started...

[12:57:10.925] Save 'ur note[Keyword] Processing complete

[12:57:10.927] Save 'ur note[Keyword] Passing output 'text7 12.57 LT' to Automation Task

[12:57:10.951] Save 'ur note[Automation Task] Running task 'Current Time' with no arguments

[12:57:10.952] Save 'ur note[Automation Task] Processing complete

[12:57:10.952] Save 'ur note[Automation Task] Passing output '1705579030' to Arg and Vars

[12:57:10.953] Save 'ur note[Arg and Vars] Processing complete

[12:57:10.953] Save 'ur note[Arg and Vars] Passing output '1705579030' to Automation Task

[12:57:10.954] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (

    1705579030

)

[12:57:10.954] Save 'ur note[Automation Task] Processing complete

[12:57:10.954] Save 'ur note[Automation Task] Passing output 'false' to Conditional

[12:57:10.955] Save 'ur note[Conditional] Processing complete

[12:57:10.955] Save 'ur note[Conditional] Passing output 'false' to Write Text File

[12:57:10.956] Save 'ur note[Write Text File] Processing complete

[12:57:10.957] Save 'ur note[Write Text File] Passing output '/Users/okn/Documents/Quick Notes/QuickNote.txt' to Post Notification

[12:57:23.835] Save 'ur note[Keyword] Processing complete

[12:57:23.864] Save 'ur note[Keyword] Passing output '' to Arg and Vars

[12:57:23.864] Save 'ur note[Arg and Vars] Processing complete

[12:57:23.865] Save 'ur note[Arg and Vars] Passing output '' to Automation Task

[12:57:23.865] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (

    ""

)

[12:57:23.865] Save 'ur note[Automation Task] Processing complete

[12:57:23.866] Save 'ur note[Automation Task] Passing output 'true' to Conditional

[12:57:23.866] Save 'ur note[Conditional] Processing complete

[12:57:23.867] Save 'ur note[Conditional] Passing output 'true' to Run Script

 

and got this:

 

Quick notes

 

1705579030

 

(Added on {isodate: EEEE dd MMMM YYYY} at {isotime: HH:mm:ss})

 

 

 

The action doesn't seem to understand that there already exists a file, and instead of appending anything just creates a new file on top of the existing (?!)

 

Hope you can find the culprit!

 

/

with best regards,

Omar KN, Stockholm, Sweden

 

On 1/17/2024 at 12:17 PM, Vero said:

@OmarKN The first thing that jumps at me is that your Automation Tasks are missing. Double-click that object and install or update the Automation Tasks.

 

https://www.alfredapp.com/help/workflows/automations/automation-task/#colours

 

QuickNote_2024-01-18_at_13.11.50.webp

Edited by OmarKN
Link to comment

Sorry tor the delay responding. Have you changed my original workflow in any way since downloading it? The only reason I ask is because the screenshot in your first post does not look like my workflow.

 

If you don't mind I think it would be helpful to see your workflow. If you are able to upload it somewhere (transfer.sh or Dropbox, for example) and let us know the link I'll take a look at it. Certainly in my original workflow any notes after the first are added to the file and a new file is not created for any note after the first—so something is not right.

 

Stephen

Link to comment
1 hour ago, Stephen_C said:

Hey and good day/ evening Stephen,

 

>Sorry for the delay responding.

 

Nema problema 🙂

 

>Have you changed my original workflow in any way since downloading it? The only reason I ask is because the screenshot in your first post does not look like my workflow.

 

Not changed anything big*, the screenshot was only an artistic representation of me not knowing what to do. Later I found out.

 

>If you don't mind I think it would be helpful to see your workflow. …

 

OK I 'll send it,

*I only tinkered with the Automation Task: Does Path Exist? and added the Debugger,

 

https://www.dropbox.com/scl/fi/se07vqgqgf2c7l699oh7e/Save-ur-note-okn.alfredworkflow

 

/

with best regards,

Omar KN, Stockholm, Sweden

On 1/17/2024 at 12:17 PM, Vero said:

@OmarKN The first thing that jumps at me is that your Automation Tasks are missing. Double-click that object and install or update the Automation Tasks.

 

https://www.alfredapp.com/help/workflows/automations/automation-task/#colours

 

Edited by OmarKN
Link to comment
1 hour ago, OmarKN said:

OK I 'll send it,

I had to log in to Dropbox and then request access. You should be able to upload the workflow to share and get a link for that. Alternatively if you approve my access request I hope I'll be able to download and look at it.

 

Stephen

Link to comment
On 1/17/2024 at 12:17 PM, Vero said:


Just now reinstalled the workflow. Behaving exactly as before, I’m curious what the problem is.

Including 3 screenshots + the debug log.

[10:22:30.100] Save 'ur note[Keyword] Processing complete
[10:22:30.100] Save 'ur note[Keyword] Passing output 'text1 after reinstall' to Automation Task
[10:22:30.100] Save 'ur note[Automation Task] Running task 'Trim Line Whitespace' with arguments (
    "text1 after reinstall"
)
[10:22:30.146] Save 'ur note[Automation Task] Processing complete
[10:22:30.147] Save 'ur note[Automation Task] Passing output 'text1 after reinstall' to Arg and Vars
[10:22:30.148] Save 'ur note[Arg and Vars] Processing complete
[10:22:30.148] Save 'ur note[Arg and Vars] Passing output 'text1 after reinstall' to Automation Task
[10:22:30.148] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (
    "text1 after reinstall"
)
[10:22:30.155] Save 'ur note[Automation Task] Processing complete
[10:22:30.155] Save 'ur note[Automation Task] Passing output 'false' to Conditional
[10:22:30.155] Save 'ur note[Conditional] Processing complete
[10:22:30.155] Save 'ur note[Conditional] Passing output 'false' to Write Text File
[10:22:30.156] Save 'ur note[Write Text File] Processing complete
[10:22:30.156] Save 'ur note[Write Text File] Passing output '/Users/okn/Documents/Quick Notes/QuickNote.txt' to Post Notification
[10:22:43.941] Save 'ur note[Keyword] Processing complete
[10:22:43.941] Save 'ur note[Keyword] Passing output '' to Arg and Vars
[10:22:43.941] Save 'ur note[Arg and Vars] Processing complete
[10:22:43.942] Save 'ur note[Arg and Vars] Passing output '' to Automation Task
[10:22:43.945] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (
    ""
)
[10:22:43.955] Save 'ur note[Automation Task] Processing complete
[10:22:43.956] Save 'ur note[Automation Task] Passing output 'true' to Conditional
[10:22:43.956] Save 'ur note[Conditional] Processing complete
[10:22:43.956] Save 'ur note[Conditional] Passing output 'true' to Run Script
[10:23:39.374] Save 'ur note[Keyword] Processing complete
[10:23:39.375] Save 'ur note[Keyword] Passing output 'text2 time 10.23LT' to Automation Task
[10:23:39.376] Save 'ur note[Automation Task] Running task 'Trim Line Whitespace' with arguments (
    "text2 time 10.23LT"
)
[10:23:39.443] Save 'ur note[Automation Task] Processing complete
[10:23:39.444] Save 'ur note[Automation Task] Passing output 'text2 time 10.23LT' to Arg and Vars
[10:23:39.444] Save 'ur note[Arg and Vars] Processing complete
[10:23:39.444] Save 'ur note[Arg and Vars] Passing output 'text2 time 10.23LT' to Automation Task
[10:23:39.444] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (
    "text2 time 10.23LT"
)
[10:23:39.447] Save 'ur note[Automation Task] Processing complete
[10:23:39.447] Save 'ur note[Automation Task] Passing output 'false' to Conditional
[10:23:39.447] Save 'ur note[Conditional] Processing complete
[10:23:39.447] Save 'ur note[Conditional] Passing output 'false' to Write Text File
[10:23:39.448] Save 'ur note[Write Text File] Processing complete
[10:23:39.448] Save 'ur note[Write Text File] Passing output '/Users/okn/Documents/Quick Notes/QuickNote.txt' to Post Notification
[10:25:26.464] Save 'ur note[Keyword] Processing complete
[10:25:26.464] Save 'ur note[Keyword] Passing output '' to Arg and Vars
[10:25:26.465] Save 'ur note[Arg and Vars] Processing complete
[10:25:26.465] Save 'ur note[Arg and Vars] Passing output '' to Automation Task
[10:25:26.467] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (
    ""
)
[10:25:26.477] Save 'ur note[Automation Task] Processing complete
[10:25:26.478] Save 'ur note[Automation Task] Passing output 'true' to Conditional
[10:25:26.478] Save 'ur note[Conditional] Processing complete
[10:25:26.478] Save 'ur note[Conditional] Passing output 'true' to Run Script
[10:26:11.878] Save 'ur note[Keyword] Processing complete
[10:26:11.879] Save 'ur note[Keyword] Passing output 'text3 10.26' to Automation Task
[10:26:11.880] Save 'ur note[Automation Task] Running task 'Trim Line Whitespace' with arguments (
    "text3 10.26"
)
[10:26:11.914] Save 'ur note[Automation Task] Processing complete
[10:26:11.914] Save 'ur note[Automation Task] Passing output 'text3 10.26' to Arg and Vars
[10:26:11.914] Save 'ur note[Arg and Vars] Processing complete
[10:26:11.914] Save 'ur note[Arg and Vars] Passing output 'text3 10.26' to Automation Task
[10:26:11.915] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (
    "text3 10.26"
)
[10:26:11.918] Save 'ur note[Automation Task] Processing complete
[10:26:11.918] Save 'ur note[Automation Task] Passing output 'false' to Conditional
[10:26:11.918] Save 'ur note[Conditional] Processing complete
[10:26:11.918] Save 'ur note[Conditional] Passing output 'false' to Write Text File
[10:26:11.919] Save 'ur note[Write Text File] Processing complete
[10:26:11.919] Save 'ur note[Write Text File] Passing output '/Users/okn/Documents/Quick Notes/QuickNote.txt' to Post Notification
[10:26:21.722] Save 'ur note[Keyword] Processing complete
[10:26:21.723] Save 'ur note[Keyword] Passing output '' to Arg and Vars
[10:26:21.723] Save 'ur note[Arg and Vars] Processing complete
[10:26:21.723] Save 'ur note[Arg and Vars] Passing output '' to Automation Task
[10:26:21.727] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (
    ""
)
[10:26:21.739] Save 'ur note[Automation Task] Processing complete
[10:26:21.739] Save 'ur note[Automation Task] Passing output 'true' to Conditional
[10:26:21.740] Save 'ur note[Conditional] Processing complete
[10:26:21.740] Save 'ur note[Conditional] Passing output 'true' to Run Script

 

Screenshot 2024-01-19 at 10.28.24.jpg

Link to comment
8 minutes ago, OmarKN said:

[10:22:30.148] Save 'ur note[Automation Task] Running task 'Does Path Exist?' with arguments (
    "text1 after reinstall"
)

This is wrong. The argument should be {var:fileFolder}/QuickNote.txt and that should appear in the relevant Automation Task. (Double click on the task to check the Path:).

 

(I must admit to a small error in the workflow—which I'll correct with an update—in that the previous store text variable, after the Trim Line Whitespace, should not be passing through the text variable.)

 

Let's take this slowly and work first on discovering how and why the correct path is not showing in the relevant Automation Task. After we sort that you should find that quick notes after the first will append to the file rather than overwriting it.

 

We can then try to work out why the date and time functions are not working correctly.

 

However, what really puzzles me is how a clean install can fail to work correctly.

 

Stephen

Link to comment

OK - that looks like progress to me. I assume notes after the first now append to the file rather than overwriting it. If that is the case we now have to work out why the isodate placeholders don't expand for you.

 

I'll have a think about it and experiment a little but in the meantime maybe @vitor will have some idea.

 

Stephen

Link to comment

Please try creating a Snippet like this:

  1. Call it something like Date & time.
  2. Use a keyword like zdt.
  3. For the snippet itself use
{isodate:EEEE dd MMMM yyyy} at {isotime: HH.mm}

 

Ensure the snippet is activated then open TextEdit and type the keyword you used for the snippet. What is the result?

 

Stephen

Link to comment

Look at the Append to File and Write Text File actions in the workflow and in place of:

{isodate: EEEE dd MMMM YYYY} at {isotime: HH:mm:ss}

subsitute what works for you. However, bear in mind those will get overwritten if you update the workflow with a new version in future.

 

The real question still remains: why does the other format not work for you? Can you post a screen shot of your System Settings → Language & Region settings?

 

Stephen

Link to comment

Nothing immediately stands out to me from that screenshot (although I'm not by any means an expert!). The only material difference in my settings from yours (aside from the selected language itself) is that my chosen date format is 19/02/024 and yours is 2024-08-19 (although I don't know why it's showing August for that date—the correct date is clearly shown at the top of that part of the pane).

 

For the moment, I can't explain why you're unable to use the {isodate} formats and we'll have to hope someone else can come up with an idea: sorry!

 

Stephen

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...