I’m just getting started with KM and I’m having problems with a macro that is intended to save a file away. My object is to use the Print menu in a particular application, Snagit, to save an image away as a PDF file with the name “temp” which I’ll be dealing with later. I can open the Save as PDF menu OK but I’m having problems entering the “temp” filename and then clicking the Save button.
Normally when the Save menu is opened the Save As box has “Untitled” as the filename and it has the focus so I thought I just has to type in the “temp” name but sometimes it doesn’t have the focus. Also the Save button is highlighted and I thought I just had to tab out of the Save As field and press return to save the document but this doesn’t work. Here’s what I’ve been using:
####DOWNLOAD:
<a class="attachment" href="/uploads/default/original/2X/0/0260f741fa5b842f021a6c3dd64f828e4fc205a4.kmmacros">SnagIT -- Save Image .kmmacros</a> (6.0 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**
---
<img src="/uploads/default/original/2X/4/457ed1f666e4943db1c88caa76506dbfb8152d4d.png" width="459" height="425">
Many thanks for this, I’ve not tried it out yet. I would though very much like to know where I was going wrong. I had intended to show my macro but I couldn’t work out how to upload it in a form other than basic text and I sent off my posting without it by error and then found I wasn’t allowed, as a first time poster, to send another postimg within 24 hours. How should I upload my Macro?
That’s grand thanks. I hadn’t realised that you can start a macro by adding it to a floating palette and I’ve changed the trigger to that as you had done. I’ve also made the other two changes and it’s working fine now.
Just one other thing. I’ve accepted the default folder to save the file to but if I wanted to change this how do I navigate to that field to change it?
Your English is very good. I was wanting, in my macro, to be able to save the file to the desktop, as I think your macro did - the default folder I’m shown is the Documents one. I suppose I could pause the macro and make this change manually but I’d like the macro to do this for me.
In order to programmatically set a path in an Open/Save dialog I would use the "Go to the folder" sheet (⇧⌘G).
First, to understand what I mean, manually open an Open/Save dialog in any program. Then press ⇧⌘G.
The "Go to the folder" sheet has two advantages:
Once invoked it has focus
You can enter any POSIX-style path (e.g. ~/Documents/blabla)
To implement it in the macro just use a "Type the Keystroke" action with "⇧⌘G", then a "Insert Text by Typing" action with the path, followed by a Return keystroke.
As always with GUI scripting, pay attention to the timing, that is, use "Pause" or "Pause until" actions where needed.
For the Documents folder, you can just type Command-Shift-O in the open/save dialog box. The macro can pause while the open/save dialog box appears, and then use the Type a Keystroke action to switch to the Documents folder.
Ah, so that’s where these shortcuts are shown. I have used the Go menu in the past to go to a folder in the root and didn’t take in all these keyboard shortcuts. Many thanks for mentioning this.
If one of the above posts solves your problem/question as originally stated, please check the "Solved" checkbox (click for details) at the bottom of that post.
Otherwise, please post your remaining questions/issues about this problem.
If you have other questions, please start a new topic.
Ah yes, hadn’t appreciated what that checkbox was for, and I’ve now checked it. I did ask another question related to my query and @Tom also answered that. I suppose I really should have started another post about that. I’m assuming I shouldn’t also check the “Solved” checkbox for the answer that @Tom gave me for that as that could be confusing but I have checked the Like box.