My AppleScript applet has a user guide in its resources folder. The guide is in PDF format. To show the guide, my applet has this code:
set path_to_Applet_alias to path to me as alias
set help_file to (path to resource "Help.pdf" in bundle path_to_Applet_alias) as string
tell application "Finder"
open file help_file
end tell
That code works. The applet is localised for a few languages. When I set the language in my applet to another language, e.g. French, that code punches an error:
"The application "Preview" can't be opened" -1703
According to Apple, the "-1703" error means "The wrong data type was detected". But, the data type hasn't changed.
I suspect something is going on with the translation but, I can't figure out what.
Any ideas ?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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.
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.
My AppleScript applet is localized for French, German, Italian and Spanish. The applet displays text in the correct language if the preferred language is changed in the "General" pane of the Language & Region preferences. That is, the applet correctly works in all four languages.
However, the "Apps" pane shows Spanish, German and Italian but, does not show French. For example:
Why would the "Apps" pane not show all languages for which the applet is localized ?
Thanks
late 2015 iMac 27", macOS 12.2.1
Topic:
Accessibility & Inclusion
SubTopic:
General
Tags:
Localization
Internationalization
AppleScript
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.
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.
I have tried to manually install binaries using Finder by clicking and dragging from the Desktop into "/usr/local/bin/". The binaries come with a collection of frameworks etc. All the binaries are adhoc signed. macOS asks for Admin credentials which is fine. But then, when I execute the binaries in Terminal, Gatekeeper shows the now expected "'[binary"] Not Opened Apple could not verify ........" etc. It shows that dialog for every component and requires user input 2-3 times to allow each component of which there are perhaps dozens.
BUT, none of that happens if I install those binaries using AppleScript. So, it might have a call like this:
do shell script "curl -L " & download_URL & " -o " & download_binary_zip with administrator privileges
do shell script "unzip -o " & download_binary_zip & " -d " & usr_bin_folder with administrator privileges
The resulting installs work perfectly.
Is this intended ? Using both install methods requires Admin credentials. Why does using a script work but using Finder does not ?
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):
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.
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 ?
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.
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.
I would like to distribute a Shortcut with my AppleScript applet (currently the work is done by an Automator Service). I have two questions:
Is it possible to automate the installation for users ? It seems that the only way a shortcut can be installed is via the Shortcuts app. So, when they ask for the Shortcut to be installed, the app must be opened and then users have to respond to the install shortcut dialog and, at least, click on "Add Shortcut".
Can that process be automated ?
A shortcut can be run from a URL, which is very useful. The URL looks like this:
shortcuts://run-shortcut?name=[name of shortcut]
However, running a shortcut from a URL always opens the Shortcuts app before running the shortcut. This breaks my code which is expecting a web browser to be active.
Is there a way of using at the shortcuts URL scheme run the shortcut in place i.e. without opening the shortcuts app ? Or, can the URL scheme be used to call the Shortcuts Event app ?
Thanks.
I'm a beginner so please forgive my use of wrong terminology.
I have been working through the Apple tutorial on SwiftUI. I tried to edit the PreviewProvider in "ContentView.swift" made a mistake and tried to revert back. I have checked that the code is now as it was when it worked.
But, the code in that file is not showing the same as before – it has none of the colours which show that Xcode has parsed and checked the code. Thus, the canvas is not showing. The code looks like this:
Nonetheless, the project builds and runs without error.
How can I make Xcode parse a file and thus show the canvas ?
My app needs to run on macOS 11+. It has one window of fixed size i.e. it should NOT be resizable.
.windowResizability(.contentSize) is only available in macOS 13+.
How can window resizability be disabled in macOS 11 and 12 ?
I'm running Xcode 16.2 on macOS 15.3.2.
Thanks.