Post

Replies

Boosts

Views

Activity

Folder aliases in Sierra not showing correct icon after restart
macOS 10.12 Sierra has a different arrangement for folder aliases which reduces their space usage. It's gone from 1.3MB down to <1KB which is great. This will save me nearly a gigabyte of disk space.However, on a restart folder aliases show a generic document icon instead of the normal folder alias icon. I can fix this issue temporarily in each folder individually by refeshing the folder view (e.g. by changing the sort order). But, the problem returns for all aliases after a restart. It doesn't seem to occur during a log off/on.This affects icons created in 10.12 as well as those created earlier.This looks a lot like a bug.Garry.
6
0
6.5k
Jul ’21
Restrict automator service to just web browsers
I have an Automator Service which uses AppleScript to copy the URL in the front tab of a web browser. Its works without requiring the user to select the URL in the address bar. Thus, it has no input. I don't want to change that behaviour.Currently the service appears in the Service Menu of all applications. I want the Service to only appear in the Service Menu of web browsers (ie. Safari, Chrome, Firefox etc).I suppose I could create a separate Service for each web browser but, that seems ridiculous.Does anyone know of a way to achieve this ?
3
0
1.3k
Feb ’21
Can a macOS service be called from a web browser bookmark ?
I have a macOS service which works well. It is invoked from the "General" section of the "Service" menu in web browsers and requires no input. The workflow contains AppleScript which does what I need. To make the Service more accessible I would like to call it using a web browser bookmark. That would require a custom URL scheme. However, as far as I can find, custom URL schemes can only call apps, not services. Is that correct ? Are custom URL schemes only able to start apps or can they call a service ? If a custom scheme can call a Service, how ? Thanks.
0
0
659
Feb ’21
Seeking documentation – AppleScript applets containing Open/Save dialogs auto-create preferences
I've just found that AppleScript applets which generate Open or Save dialogs (e.g. via NSPathControl's NSPathStylePopUp) automatically create a preference file in the user's home preferences folder. The file has the same name as the applet's ID (e.g. com.apple.script.id.myapplet.plist). The file might contain value-key pairs for NSNavLastRootDirectory, NSNavPanelExpandedSizeForOpenMode, NSWindow Frame NSNavPanelAutosaveName etc. I have Googled and search but have not been able to find documentation on this. Is there any documentation which explains this behaviour and provides advice on how to use it ? Thanks.
2
0
746
Sep ’21
SwiftUI Tutorial – Can't understand what instructions mean
I have been trying hard to work through the first SwiftUI tutorial. It's supposed to take only 40 mins. But, I have been trying all day and got only to Section 4, Step 3. I have found nearly every step to be hard because the language is new and there are no definitions or glossary to help understand what things mean. For example, I had to Google "lifecycle" and read a great simple explanation on another site before I understood what it means. Anyway, in Step 3 it says: "Replace the text view with the image of Turtle Rock by using the Image(_:) initializer, passing it the name of the image to display." Now, how do I replace the text view with the Image(:)initializer – what IS an Image(:) initializer ? [And why does some of the text I've just typed show in italics ?] Where is it ? – I'm staring at XCode and not seeing it. I tried typing over this: Text("Hello, World!") and replaced that with Image(_:). But the result was an impenetrable error: "Cannot find 'Image' in scope" ! So, what does scope mean in this context ? And, next, how do I "pass" anything to it ? The image ? The word "Image" ? Something else ? What does "pass" mean ? Do I type the name of the image file somewhere, if so, where ? The next Step scares the willies out of me: "Add a call to clipShape(Circle()) to apply the circular clipping shape to the image." What is a call and where do I find a "clipShape" ? OK I just typed in "clipShape(Circle())" and seemed to do something but now I get this error: Instance method 'clipShape(_:style:)' requires that 'some View' conform to 'Shape'". Then Step 5 says: "Create another circle with a gray stroke, and then add it as an overlay to give the image a border." So, where is this "gray stroke" thing ? And how do I add it as an overlay ? Do I click and drag something into somewhere ? I'm not a total dill. I've been running an AppleScript applet on GitHub for 4 years and it works. I've used something like 20 scripting and similar languages over the decades. I first used an Apple Mac in 1986. SwiftUI looks like a good option for re-developing the applet. But, at this rate it'll take another 4 years. Can anyone talk me down to a safe landing ?
1
0
918
Sep ’21
How to create a Python3 runtime
My AppleScript applet provides a GUI for a Python script. A new version of the Python script requires Python3. That means I need to include a Python3 runtime with my applet (or provide a way for users to install). I know almost nothing about Python. How can I create a Python3 runtime for users ? What is in a Python runtime for users ? Must the runtime be in my applet's bundle or must it be installed somewhere ? Must the runtime include all the developer tools that come with Python (e.g. IDLE) ?
0
0
730
Sep ’21
Seeking suggestions - how to have versions of an Automator service workflow
I have a workflow which is installed as a Service. It is used to call code in my AppleScript applet. The Service has one action: a "Run AppleScript" action. I update the Service quite often with improvements. I need a way to know whether my users' copy of the Service is out-of-date. I have developed some ideas: First is to compare file size of user's copy against the copy being distributed. If they are different, then, the user's copy is out-of-date and needs to be updated. That works except that users need to be able to retain changes to their copy of the Service which should not be over-written my by applet. Second is to make a custom property in the workflow's info.plist file. That, however, is over-written by Automator when it saves the workflow. Third is to add a comment to the AppleScript code inside the workflow which can be interrogated by my applet. That does work but, opening and reading the workflow file seems like over-kill and runs the risk of that file being over-written or the XML code being corrupted. Fourth is to add a plain text file to the contents of the workflow which would contain the version detail. My applet could then interrogate that file to get the version and this know whether the user's copy is out-of-date. I'm inclined to using the 4th idea. However, all of those ideas are kludges. Is there an Apple sanctioned method of versioning an Automator service workflow ? Thanks.
5
0
1.5k
Feb ’22
Mac Studio – Wake from sleep – Desktop picture not stretching to fill Desktop
On wake from sleep the Mac Studio's Desktop picture is shown in actual resolution instead of stretched to fit screen. For example, a picture which is 2059 × 1371 is shown at that resolution on a 5K Retina screen and so only fills about 60% of the screen area. It starts with the picture positioned in the top left corner but sometimes moves down the screen. This behaviour does not change if the screen is scaled up or down – the picture size is also scaled. Notice that icons on the Desktop are displayed in the correct position. At the same time, the Dock is shown at the bottom of the picture instead of at the bottom of the screen. Usually, the Desktop redisplays correctly. But increasingly, the only solution is to log out and in again. This might be related to my other question on the Desktop picture Pref Pane. See attached example which is a full screen capture i.e. command-shift-3 (with my personal details obscured):
3
0
1.1k
Jan ’25
AppleScript tell Finder to open file => Permission error
I have a plain text file saved to my Desktop the result of an earlier script. I have a simple AppleScript telling Finder to open the text file: set open_this to (path to desktop as text) & "Test.txt" tell application "Finder" to open alias open_this This results in the error: "The document "Test.txt" could not be opened. You don't have permission. To view or change permissions, select the item in the Finder and choose File > Get Info." Weirdly, if I duplicate the text file and tell Finder to open it I get: "Finder got an error: Handler can’t handle objects of this class." I've check permissions on the file and they look normal – my user account has read & write permission. I have given "Full Disk Access" to Script Debugger, my AppleScript IDE. This was a known bug in macOS 12.3/12.3.1 and I thought it has been fixed in 12.4 when I tested the beta. But, it is definitely a bug in macOS 12.4. Does anyone have a way in AppleScript of telling Finder to open a file ?
0
0
1.7k
Jul ’22
Cannot install macOS 13.0.1 update
My Apple ID a member of the Apple Developer Program. So, Software Update shows that I can install Ventura 13.1 beta 2 which is fine. I want to install the Ventura 13.0.1 update. But, Software Update does not show the 13.0.1 update (see capture). Is there a way to force Software Update to show production updates as well as beta versions ? Thanks.
4
0
2k
Nov ’22
Ventura – Applescript applets no longer hide ?
Ventura 12.3 seems to have broken part of my Applescript applet – it no longer hides reliably. Previously pressing command-h or choosing the app menu=>Hide [applet] would cause the applet to hide. This has been working for over 5 years. Now, sometimes, the applet does not hide – instead it just loses the focus. Then, clicking on the applet does not give it the focus – but clicking on the titlebar does. But, often, the applet hides normally. I can't find a pattern except it might make a difference if hiding the applet would shift focus to Finder. If this is due to an announced change in Ventura can someone point me to the documentation ? Otherwise, what could be going on ? Thanks.
4
0
1.3k
Nov ’22
NSBox – What is difference between BoxType.separator and BoxType.primary
Documentation says: BoxType.primary Specifies the primary box appearance. BoxType.separator Specifies that the box is a separator. Nice, but what does it mean ? What does a "primary" box look like ? How is it different to a "secondary" box ? I have tried both forms (in ASOC) and they look the same. So, is there a difference in how they look ? Thanks.
2
0
818
Mar ’23
AppleScript – "text item delimiters" uses non-specified delimiters - FIXED
SOLVED I want to parse some plain text and pull out the 11th and 13th words. I can't get it to work because "text item delimiters" sometimes treats additional characters as delimiters. set test_text to "one two three four five six seven eight nine ten elev-en twelve thir-teen" set AppleScript's text item delimiters to "" set AppleScript's text item delimiters to {" "} set word_11 to word 11 of test_text set word_12 to word 12 of test_text set word_13 to word 13 of test_text set word_14 to word 14 of test_text set word_15 to word 15 of test_text set AppleScript's text item delimiters to "" log word_11 & " " & word_12 & " " & word_13 & " " & word_14 & " " & word_15 The result is: (elev en twelve thir teen) But the result should be an error – it should NOT be using the hyphen as a delimiter. Why is the hyphen being used as a delimiter ? UPDATE: Because I should be using "text item" instead of "word"
0
0
973
Mar ’23
Notarising applet: "Error: No Keychain password item found for profile: <>"
I am trying to submit my AppleScript applet for notarization. My applet is code signed using my developer id. I have stored an app-specific password in my logins keychain with the correct name and account. My developer id is not connected with multiple teams. I tried this on the command line: xcrun notarytool submit "/Users/[home]/Desktop/[applet].zip" --keychain-profile "[name]" --wait The response, very quickly, was: "Error: No Keychain password item found for profile: [name]". Is something else needed to enable notarytool to find the Keychain login item ? Thanks.
3
0
2.2k
Apr ’23
Can't get "shortcuts sign" to work
According to the Shortcuts User Guide, the following command should sign a shortcut: shortcuts sign --mode anyone --input "Share me.shortcut" --output "Share me signed.shortcut" I have tried that formulation but get this error: Error: The file couldn’t be opened because it isn’t in the correct format. So, I tried to sign an exported shortcut: shortcuts sign --mode anyone --input /Users/[Home]/Test.shortcut --output /Users/[Home]/Test-signed.shortcut That returns nothing suggesting there was no error. But codesign says: /Users/[Home]/Test-signed.shortcut: code object is not signed at all Is code signing working for shortcuts ? Is there a way to sign a shortcut ?
0
0
750
Apr ’23