AppleScript

RSS for tag

AppleScript allows users to directly control scriptable Macintosh applications as well as parts of macOS itself.

Posts under AppleScript tag

200 Posts

Post

Replies

Boosts

Views

Activity

applescript no longer working since upgrade to monterey
The following applescript is no longer working since I upgraded to Monterey. Can someone please take a look and let me know how to fix this? I would SO appreciate it. tell application "Finder" set the_folder to choose folder set the_folder_name to name of the_folder set the_subfolders to every folder in the_folder repeat with I from 1 to count of the_subfolders set file_name to name of every file of item I of the_subfolders set name of every file of item I of the_subfolders to the_folder_name & "-" & name of item I of the_subfolders & "-" & file_name move every file of item I of the_subfolders to the_folder end repeat -- -- optionally delete the subfolders -- delete every folder in the_folder -- put two dashes in front of this line to comment it out end tell
5
1
751
Oct ’22
how to rename using applescript in monterey?
In High sierra, I made a working applescript that bulk renames and moves files. In monterey, not only does it not work, but apparently I can't rename anything? I made something simple like the below script and even that gives me a 10003 error (access not allowed). is there a permission somewhere I need to turn on? tell application "Finder" set theFile to "hello world.txt" set theName to "hello" set the {name} of file theFile to theName & ".txt" end tell
2
0
690
Oct ’22
creating a custom keyboard shortcut to toggle accessibility item “Speak items under the pointer” on/off
Disclaimer: I'm not a developer, so please bear with me! I’m looking for the best way to create a custom keyboard shortcut for apple’s accessibility setting to toggle “Speak items under the pointer” on/off. From my research, it’s my understanding that you can use Apple’s ‘Automator’ or ‘Shortcuts’ app. I see both a “Run AppleScript” option and “Run JavaScript for Mac Automation”. Might anyone be able to provide me with a copy and paste script which can create this keyboard shortcut? (Suggestions on the best way to do this/app to use and non-developer friendly instructions would also be greatly appreciated! 😂) Thank you in advance! (If needed, I'm running Monterey 12.6 on a MacBook Pro with an M1 chip)
1
0
1k
Sep ’22
Scripting Notification Center buttons in Big Sur
I've got a script that calls phone the number highlighted on the screen. It invokes FaceTime to place the call. FaceTime displays a dialog via the Notification Center asking if I want to call the number or cancel. My scripted clicked the "Call" button. That worked...until Big Sur. Now I get: The action “Run AppleScript” encountered an error: “System Events got an error: Can’t get button 1 of application process "Notification Center". Invalid index.” when I run it. I can't show you the pre Big Sur script because I modified it for Big Sur. Yes, not having a backup was dumb. What I'm trying now is: on run {input, parameters} open location "tel://" & input & "?audio=yes" tell application "System Events" click button "Call" of scroll area 1 of window "Notification Center" of application process "Notification Center" end tell end run This is just one of the things I tried. Under Big Sur, accessibility Inspector shows that button hierarchy and if I hit "press" under actions, it presses the button. How do I access the button via AppleScript? Here's the hierarchy: ⌄Notification Center (application) [Application] ⌄Notification Center (system dialog) [NotificationCenter.NotificationCenterWindow] ⌄<empty description> (scroll area) [SwiftUI.HostingScrollView] ⌖Call (Button) [BorderlessButtonCell] <empty descriptipn> (image) [NSImageCell] Rob Osattin (text) [NSTextFieldCell] Click Call to make this call (text) [NSTextFieldCell] Cancel (button) [BorderlessButtonCell] <empty description> (group) [VibrantBox] <empty description> (group) [VibrantBox] Thanks, Rob Osattin Atlanta
2
0
1.8k
Sep ’22
[AppleScript] How to force font size in Notes app when pasting from clipboard?
Hi all, I'm a total newbie at AppleScript. Hope I can find some help here:) I have put together a script that will copy the text I have highlighted on Safari, and paste it into a specific Note with just a keyboard shortcut. However, I realised when the text gets pasted into the Note, the is almost like the default font size, which is very small. I have tried changing the default font size under Note > Preferences, but the pasted text causes the sizes of the other text to get smaller and smaller every time I run the script, until all reaches the smallest size of 8. Is there any script I can include to force it to adhere to the system default when the text is pasted in? Here is the script I have written: -- Copy selected text to clipboard: tell application "System Events" to keystroke "c" using {command down} delay 1 set noteName to "My Note" set entry to return & (the clipboard) tell application "Notes" tell account "iCloud" set body of note noteName to (get body of note noteName & entry) end tell end tell
1
1
904
Sep ’22
Recordable application (stopped being recordable)
Our application (sandboxed, on the mac) sends Apple Events to itself for being recordable in Script Editor. Alas, I just noted that this feature stopped working, i.e. at least under macOS 12.4 Script Editor does not see what our application does. I am not sure when (i.e. under what macOS) recordability stopped working, but it is gone on 12.4. We have tried, (for testing), to set the sandbox exception com.apple.security.temporary-exception.apple-events to true, but it makes no difference. I know that Apple Script in general, and recordability in particular, are badly out of fashion these days, so we are considering dropping recordability anyway. But if there's an easy way to keep it working, I'd be interested. Thanks for any advice in advance
7
0
2.5k
Aug ’22
Reminders - Open List in New Window
Hi, I would like to update the following code to open my Reminders list in a new window. Any suggestions? Thx Gianandrea tell application "System Events" to tell process "Reminders" click menu item "Open List in New Window" of menu 1 of menu bar item "Window" of menu bar 1 click menu item "Reminders" of menu 1 of menu bar item "Window" of menu bar 1 end tell
0
0
937
Aug ’22
Post 12.5 update install, compiled AppleScript getting "not allowed assistive access" error.
Curious if anyone else has encountered this and if a workaround has been found: I have an AppleScript that manipulates files (xattrs, filename, path) within the running user's home directory. It is running as a compiled application signed to run locally. It has been added to Accessibility section of the Privacy and Security pane of System preferences. It ran quite happily before the 12.5 update was installed. After installing the 12.5 public release, it gives the "System Events got an error. (script name) is not allowed assistive access. (-25211)" error immediately on launch. I have removed the compiled script from the Accessibility group in Security and Privacy System Preferences pane, then re-added it. This did not help. I have given the compiled script Full Disk Access via the Security and Privacy pane. This also did not resolve the issue. Oh - I can run the script in uncompiled form from within Script Editor with no issues. It's only the locally signed compiled application that gives the error. Any suggestions?
0
0
1.1k
Jul ’22
Mail Signatures
Hi all, first post on here so be gentle please! Is it possible to use AppleScript to handle the creation of HTML signatures. Ideally I want to check if a signature with a given name already exists, I guess that's easy enough. Delete it if it does. Create a new HTML signature and then attach this new signature to be the default for a given account. Any help, greatly appreciated. Regards, Dave.
0
0
505
Jul ’22
NSAppleEventsUsageDescription entitlement without a development certificate for local use
I am trying to build a macOS application that invokes NSAppleScript that controls Safari, but in order to do so, I need the NSAppleEventsUsageDescription entitlement set. However, this entitlement requires, from my understanding, a paid developer account for the signing certificate (free provisioned certificates don't appear to be able to work). I only want to be able to run this application locally for personal use. Here are some less than ideal options I've considered: Invoking NSUserAppleScriptTask instead and creating custom script files Running the generated application binary directly from Terminal which supports these entitlements Using SafariServices (however when I tried doing so, functions like getAllWindows would not seem to fire but this is a separate issue) Code signing with a self generated local root certificate (this did not work) Buying into the paid developer programme (I'd rather not) Are there any other options? I am on macOS Monterey 12.4 and using Xcode 13.4.1.
2
0
2k
Jul ’22
NSAppleScript memory leak
Platform: macOS 12.3.1 Xcode: 13.3 I had Xcode ARC turned ON. AppleScript should be declared like below. NSAppleScript *script = [[NSAppleScript alloc] initWithSource:strScript]; When call AppleScript, open "Monitor.app" app will observe some memory leak. I try to wrap AppleScript by autoReleasePool. Memery leak still exists @autoreleasepool { NSAppleScript *script = [[NSAppleScript alloc] initWithSource:strScript]; //script to do something } Is there other suggestion to do gabage collection to release memory?
15
0
2.8k
Jul ’22
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
when moving a file into a folder, is it possible to move duplicates inside that folder?
I have an apple script which moves all files within a folder into a new folder according to the first 6 characters of the filenames. If the folder already exists, the files get moved into that existing folder instead. If the file already exists in the new/existing folder, the file to be moved into the folder gets a "copy" extension to the filename – which is not in the script, it's a system function ;-) My question: **Is it possible to move all existing files into a subfolder (named "_alt" for example), before the other files get the "copy"-extension? ** This is my existing script: set mgFilesFolder to (choose folder with prompt "Choose folder…") (* get the files of the mgFilesFolder folder *) tell application "Finder" to set fileList to files of mgFilesFolder (* iterate over every file *) repeat with i from 1 to number of items in fileList set this_item to item i of fileList set this_file_Name to name of this_item as string set thisFileCode to characters 1 thru 6 of this_file_Name as text log thisFileCode tell application "Finder" try set nf to make new folder at mgFilesFolder with properties {name:thisFileCode} end try end tell end repeat set sourceFolder to mgFilesFolder set destinationFolder to mgFilesFolder tell application "Finder" set the_files to (get files of mgFilesFolder) repeat with this_file in the_files
1
0
495
Jul ’22
Using AppleScript in Orion browser to open a new tab
I am trying to write an AppleScript to control Orion, a new privacy-focused browser, that will open a new tab in the frontmost window with a specified URL. However, I am getting the result "missing value". Orion is in beta, and I’m inexperienced with AppleScript, so I can’t tell if the problem is with me or with the browser.  Any help would be appreciated! What I have now is: tell application "Orion" make new tab at window 1 with properties {URL:"https://twitter.com"} end tell I have tried variations, listed at the end of this post. Orion does have basic AppleScript support: Here are the variations I've tried: tell application "Orion"   tell window 1     make new tab at beginning with properties {URL:"https://twitter.com"}   end tell end tell tell application "Orion"   make new tab at end of tabs of window 1 with properties {URL:"https://twitter.com"} end tell tell application "Orion" to tell window 1   make new tab with properties {URL:"https://twitter.com"} end tell tell application "Orion" make new document -- maybe this. Creates window make new tab at end of tabs of window 1 with properties {URL:"https://twitter.com"} end tell
2
0
1.2k
Jul ’22
Not authorized to send Apple events to Finder. (error -1743)
I have a simple ApplScript which I have decided to put into a User Interface. In Xcode, I have made an AppleScript project and started to copy the code from the AppleScript into Xcode. From a button I have the following code on btnFolderClick_(sender) set theFolderPath to (choose folder with prompt "Choose The Folder With Scans") #Count Number Of Images in Folder tell application "Finder" set numberOfImages to number of files in folder (((theFolderPath))) end tell end btnFolderClick_ When I Run it, I am getting the following error... -[AppDelegate btnFolderClick:]: Not authorized to send Apple events to Finder. (error -1743) I sort of understand the error but not sure how to proceed. Can anyone offer any solution please. Thank You
0
0
987
Jul ’22
Execute script on macOS with avoid macOS user password prompt
Hi All, I'm looking to execute some application installation in silent mode. Currently, the main issue is avoiding macOS user password prompt by pop-up dialogs with the user's password. The main idea (of the solution, I suggest) - is providing a macOS username & password as script parameters (inside the script). I've tried several ways including AppleScript usage, based on providing a username & password, and "with administrator privileges"... Also - AppleScript usage, based on application run (like: tell application "Terminal")... Tried - shell scripts... No success! Not sure if I'm doing this is correct enough, or if the selected solution is correct at all. The maximum that I've got: is silent execution stuck (all over attempts - pop the user password dialog). Thanks a lot!
0
0
608
Jul ’22
applescript no longer working since upgrade to monterey
The following applescript is no longer working since I upgraded to Monterey. Can someone please take a look and let me know how to fix this? I would SO appreciate it. tell application "Finder" set the_folder to choose folder set the_folder_name to name of the_folder set the_subfolders to every folder in the_folder repeat with I from 1 to count of the_subfolders set file_name to name of every file of item I of the_subfolders set name of every file of item I of the_subfolders to the_folder_name & "-" & name of item I of the_subfolders & "-" & file_name move every file of item I of the_subfolders to the_folder end repeat -- -- optionally delete the subfolders -- delete every folder in the_folder -- put two dashes in front of this line to comment it out end tell
Replies
5
Boosts
1
Views
751
Activity
Oct ’22
how to rename using applescript in monterey?
In High sierra, I made a working applescript that bulk renames and moves files. In monterey, not only does it not work, but apparently I can't rename anything? I made something simple like the below script and even that gives me a 10003 error (access not allowed). is there a permission somewhere I need to turn on? tell application "Finder" set theFile to "hello world.txt" set theName to "hello" set the {name} of file theFile to theName & ".txt" end tell
Replies
2
Boosts
0
Views
690
Activity
Oct ’22
creating a custom keyboard shortcut to toggle accessibility item “Speak items under the pointer” on/off
Disclaimer: I'm not a developer, so please bear with me! I’m looking for the best way to create a custom keyboard shortcut for apple’s accessibility setting to toggle “Speak items under the pointer” on/off. From my research, it’s my understanding that you can use Apple’s ‘Automator’ or ‘Shortcuts’ app. I see both a “Run AppleScript” option and “Run JavaScript for Mac Automation”. Might anyone be able to provide me with a copy and paste script which can create this keyboard shortcut? (Suggestions on the best way to do this/app to use and non-developer friendly instructions would also be greatly appreciated! 😂) Thank you in advance! (If needed, I'm running Monterey 12.6 on a MacBook Pro with an M1 chip)
Replies
1
Boosts
0
Views
1k
Activity
Sep ’22
Export image from Photos Apple Script
Don't even know where to start given how byzantine Photos are and its miniscule AS dictionary. Need to export the underlying original file of the current selection in Photos to some other folder on my disk (not a Folder in Photos) and delete the selection. Any help?
Replies
0
Boosts
0
Views
1.1k
Activity
Sep ’22
Using AppleScripts remote with @ part of password login
I have an @ for part of the password for "eppc://" & user_name & ":" & pass_word & "@" & localHost. How do I get around people that use the @ symbol to log into an Apple Script?
Replies
1
Boosts
0
Views
639
Activity
Sep ’22
Scripting Notification Center buttons in Big Sur
I've got a script that calls phone the number highlighted on the screen. It invokes FaceTime to place the call. FaceTime displays a dialog via the Notification Center asking if I want to call the number or cancel. My scripted clicked the "Call" button. That worked...until Big Sur. Now I get: The action “Run AppleScript” encountered an error: “System Events got an error: Can’t get button 1 of application process "Notification Center". Invalid index.” when I run it. I can't show you the pre Big Sur script because I modified it for Big Sur. Yes, not having a backup was dumb. What I'm trying now is: on run {input, parameters} open location "tel://" & input & "?audio=yes" tell application "System Events" click button "Call" of scroll area 1 of window "Notification Center" of application process "Notification Center" end tell end run This is just one of the things I tried. Under Big Sur, accessibility Inspector shows that button hierarchy and if I hit "press" under actions, it presses the button. How do I access the button via AppleScript? Here's the hierarchy: ⌄Notification Center (application) [Application] ⌄Notification Center (system dialog) [NotificationCenter.NotificationCenterWindow] ⌄<empty description> (scroll area) [SwiftUI.HostingScrollView] ⌖Call (Button) [BorderlessButtonCell] <empty descriptipn> (image) [NSImageCell] Rob Osattin (text) [NSTextFieldCell] Click Call to make this call (text) [NSTextFieldCell] Cancel (button) [BorderlessButtonCell] <empty description> (group) [VibrantBox] <empty description> (group) [VibrantBox] Thanks, Rob Osattin Atlanta
Replies
2
Boosts
0
Views
1.8k
Activity
Sep ’22
[AppleScript] How to force font size in Notes app when pasting from clipboard?
Hi all, I'm a total newbie at AppleScript. Hope I can find some help here:) I have put together a script that will copy the text I have highlighted on Safari, and paste it into a specific Note with just a keyboard shortcut. However, I realised when the text gets pasted into the Note, the is almost like the default font size, which is very small. I have tried changing the default font size under Note > Preferences, but the pasted text causes the sizes of the other text to get smaller and smaller every time I run the script, until all reaches the smallest size of 8. Is there any script I can include to force it to adhere to the system default when the text is pasted in? Here is the script I have written: -- Copy selected text to clipboard: tell application "System Events" to keystroke "c" using {command down} delay 1 set noteName to "My Note" set entry to return & (the clipboard) tell application "Notes" tell account "iCloud" set body of note noteName to (get body of note noteName & entry) end tell end tell
Replies
1
Boosts
1
Views
904
Activity
Sep ’22
Applescript: get column span or rowspan of Word table cell
How do I determine how many columns or rows a Word table cell is spanning? set theSpan to ___ of cell 1 of text object of table 1 The syntax eludes me. Thanks!
Replies
1
Boosts
0
Views
702
Activity
Aug ’22
Recordable application (stopped being recordable)
Our application (sandboxed, on the mac) sends Apple Events to itself for being recordable in Script Editor. Alas, I just noted that this feature stopped working, i.e. at least under macOS 12.4 Script Editor does not see what our application does. I am not sure when (i.e. under what macOS) recordability stopped working, but it is gone on 12.4. We have tried, (for testing), to set the sandbox exception com.apple.security.temporary-exception.apple-events to true, but it makes no difference. I know that Apple Script in general, and recordability in particular, are badly out of fashion these days, so we are considering dropping recordability anyway. But if there's an easy way to keep it working, I'd be interested. Thanks for any advice in advance
Replies
7
Boosts
0
Views
2.5k
Activity
Aug ’22
Reminders - Open List in New Window
Hi, I would like to update the following code to open my Reminders list in a new window. Any suggestions? Thx Gianandrea tell application "System Events" to tell process "Reminders" click menu item "Open List in New Window" of menu 1 of menu bar item "Window" of menu bar 1 click menu item "Reminders" of menu 1 of menu bar item "Window" of menu bar 1 end tell
Replies
0
Boosts
0
Views
937
Activity
Aug ’22
Post 12.5 update install, compiled AppleScript getting "not allowed assistive access" error.
Curious if anyone else has encountered this and if a workaround has been found: I have an AppleScript that manipulates files (xattrs, filename, path) within the running user's home directory. It is running as a compiled application signed to run locally. It has been added to Accessibility section of the Privacy and Security pane of System preferences. It ran quite happily before the 12.5 update was installed. After installing the 12.5 public release, it gives the "System Events got an error. (script name) is not allowed assistive access. (-25211)" error immediately on launch. I have removed the compiled script from the Accessibility group in Security and Privacy System Preferences pane, then re-added it. This did not help. I have given the compiled script Full Disk Access via the Security and Privacy pane. This also did not resolve the issue. Oh - I can run the script in uncompiled form from within Script Editor with no issues. It's only the locally signed compiled application that gives the error. Any suggestions?
Replies
0
Boosts
0
Views
1.1k
Activity
Jul ’22
Mail Signatures
Hi all, first post on here so be gentle please! Is it possible to use AppleScript to handle the creation of HTML signatures. Ideally I want to check if a signature with a given name already exists, I guess that's easy enough. Delete it if it does. Create a new HTML signature and then attach this new signature to be the default for a given account. Any help, greatly appreciated. Regards, Dave.
Replies
0
Boosts
0
Views
505
Activity
Jul ’22
NSAppleEventsUsageDescription entitlement without a development certificate for local use
I am trying to build a macOS application that invokes NSAppleScript that controls Safari, but in order to do so, I need the NSAppleEventsUsageDescription entitlement set. However, this entitlement requires, from my understanding, a paid developer account for the signing certificate (free provisioned certificates don't appear to be able to work). I only want to be able to run this application locally for personal use. Here are some less than ideal options I've considered: Invoking NSUserAppleScriptTask instead and creating custom script files Running the generated application binary directly from Terminal which supports these entitlements Using SafariServices (however when I tried doing so, functions like getAllWindows would not seem to fire but this is a separate issue) Code signing with a self generated local root certificate (this did not work) Buying into the paid developer programme (I'd rather not) Are there any other options? I am on macOS Monterey 12.4 and using Xcode 13.4.1.
Replies
2
Boosts
0
Views
2k
Activity
Jul ’22
NSAppleScript memory leak
Platform: macOS 12.3.1 Xcode: 13.3 I had Xcode ARC turned ON. AppleScript should be declared like below. NSAppleScript *script = [[NSAppleScript alloc] initWithSource:strScript]; When call AppleScript, open "Monitor.app" app will observe some memory leak. I try to wrap AppleScript by autoReleasePool. Memery leak still exists @autoreleasepool { NSAppleScript *script = [[NSAppleScript alloc] initWithSource:strScript]; //script to do something } Is there other suggestion to do gabage collection to release memory?
Replies
15
Boosts
0
Views
2.8k
Activity
Jul ’22
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 ?
Replies
0
Boosts
0
Views
1.7k
Activity
Jul ’22
when moving a file into a folder, is it possible to move duplicates inside that folder?
I have an apple script which moves all files within a folder into a new folder according to the first 6 characters of the filenames. If the folder already exists, the files get moved into that existing folder instead. If the file already exists in the new/existing folder, the file to be moved into the folder gets a "copy" extension to the filename – which is not in the script, it's a system function ;-) My question: **Is it possible to move all existing files into a subfolder (named "_alt" for example), before the other files get the "copy"-extension? ** This is my existing script: set mgFilesFolder to (choose folder with prompt "Choose folder…") (* get the files of the mgFilesFolder folder *) tell application "Finder" to set fileList to files of mgFilesFolder (* iterate over every file *) repeat with i from 1 to number of items in fileList set this_item to item i of fileList set this_file_Name to name of this_item as string set thisFileCode to characters 1 thru 6 of this_file_Name as text log thisFileCode tell application "Finder" try set nf to make new folder at mgFilesFolder with properties {name:thisFileCode} end try end tell end repeat set sourceFolder to mgFilesFolder set destinationFolder to mgFilesFolder tell application "Finder" set the_files to (get files of mgFilesFolder) repeat with this_file in the_files
Replies
1
Boosts
0
Views
495
Activity
Jul ’22
Using AppleScript in Orion browser to open a new tab
I am trying to write an AppleScript to control Orion, a new privacy-focused browser, that will open a new tab in the frontmost window with a specified URL. However, I am getting the result "missing value". Orion is in beta, and I’m inexperienced with AppleScript, so I can’t tell if the problem is with me or with the browser.  Any help would be appreciated! What I have now is: tell application "Orion" make new tab at window 1 with properties {URL:"https://twitter.com"} end tell I have tried variations, listed at the end of this post. Orion does have basic AppleScript support: Here are the variations I've tried: tell application "Orion"   tell window 1     make new tab at beginning with properties {URL:"https://twitter.com"}   end tell end tell tell application "Orion"   make new tab at end of tabs of window 1 with properties {URL:"https://twitter.com"} end tell tell application "Orion" to tell window 1   make new tab with properties {URL:"https://twitter.com"} end tell tell application "Orion" make new document -- maybe this. Creates window make new tab at end of tabs of window 1 with properties {URL:"https://twitter.com"} end tell
Replies
2
Boosts
0
Views
1.2k
Activity
Jul ’22
Not authorized to send Apple events to Finder. (error -1743)
I have a simple ApplScript which I have decided to put into a User Interface. In Xcode, I have made an AppleScript project and started to copy the code from the AppleScript into Xcode. From a button I have the following code on btnFolderClick_(sender) set theFolderPath to (choose folder with prompt "Choose The Folder With Scans") #Count Number Of Images in Folder tell application "Finder" set numberOfImages to number of files in folder (((theFolderPath))) end tell end btnFolderClick_ When I Run it, I am getting the following error... -[AppDelegate btnFolderClick:]: Not authorized to send Apple events to Finder. (error -1743) I sort of understand the error but not sure how to proceed. Can anyone offer any solution please. Thank You
Replies
0
Boosts
0
Views
987
Activity
Jul ’22
Execute script on macOS with avoid macOS user password prompt
Hi All, I'm looking to execute some application installation in silent mode. Currently, the main issue is avoiding macOS user password prompt by pop-up dialogs with the user's password. The main idea (of the solution, I suggest) - is providing a macOS username & password as script parameters (inside the script). I've tried several ways including AppleScript usage, based on providing a username & password, and "with administrator privileges"... Also - AppleScript usage, based on application run (like: tell application "Terminal")... Tried - shell scripts... No success! Not sure if I'm doing this is correct enough, or if the selected solution is correct at all. The maximum that I've got: is silent execution stuck (all over attempts - pop the user password dialog). Thanks a lot!
Replies
0
Boosts
0
Views
608
Activity
Jul ’22
Applescripting multi strings into one
Trying to create a "master" string containing results from other strings. But sometimes the strings are undefined because they weren't selected as an option. I tried else if... is not equal to... but that didn't work. Im trying to avoid having to write out every possible combination. Heres the current script.
Replies
2
Boosts
0
Views
1.1k
Activity
Jul ’22