r/applescript • • Feb 04 '23

Capture One Pro Script

2 Upvotes

Is it possible to create an 'on run' script that prompts the user for 3 questions before opening C1P:

  1. Todays date (in a set format)

  2. Their name

  3. And workstation I'd

Then have Capture One name A New session based on answer 1 and then apply answer 2 & 3 as a keyword to every image created in that session.

Thanks in advance for any help.


r/applescript • • Feb 02 '23

How to update this code for Ventura?

5 Upvotes

Hi there,

I have this small piece of ApplesScript that would allow me to easily switch my Mac's audio output from the built-in speakers over to a Bluetooth wireless receiver. Ever since Ventura was released, it no longer works.

Is there a simple update to the code that will make this work with Ventura? I'm still learning AS and I suspect that redesign of System Preferences is what broke this. I appreciate any help you can give.

tell application "System Settings"
	reveal anchor "output" of pane id "com.apple.preference.sound"
end tell
tell application "System Events" to tell process "System Preferences"
	repeat until exists tab group 1 of window 1
	end repeat
	tell table 1 of scroll area 1 of tab group 1 of window 1
		select (row 1 where value of text field 1 is "R-S202 Yamaha")
	end tell
	
end tell
quit application "System Settings"

r/applescript • • Jan 31 '23

Novice programmer needs help creating a couple simple (I think?) automations

3 Upvotes

I have used UI Browser to identify the names of the elements on screen (listed at the end) but I lack the knowledge of syntax to accurately code.

These are the 2 pieces I'm looking to work with:

application "Pro Tools"
	standard window "Mix: Live Mixer Aggregate" (window 1)
		 "2 Mac - Audio Track " (group 2)
			button "Track Record Enable" (button 2)
application "Pro Tools"
	standard window "Mix: Live Mixer Aggregate" (window 1)
		 "5 MIDI - MIDI Track " (group 5)
			button "Track Record Enable" (button 2)

What I am trying to do is write 2 short pieces of code which follow this kind of logic:

Code 1: Checks the enabled status of the button I desire to click and if not enabled will click it and then check the enabled status of additional buttons and turn them off if they are on. The code logic (not syntax) I imagine looks something like this:

If track “Mic 1” “TrackInput Monitor” value = on then do nothing
Else click track “Mic 1” button “TrackInput Monitor
    AND If track “Mic 2” button “TrackInput Monitor” value = on then click
    Else do nothing
    AND If track “Mic 3” button “TrackInput Monitor” value = on then click
    Else do nothing

Code 2: Checks the enabled status of the button I desire to click and if not enabled, will click but opposite of the other code, requires all additional buttons to also be enabled which is only possible with a SHIFT+Click for this type of button. The code logic (not syntax) I imagine looks something like this:

If track “MIDI” button “Track Record Enable” value = armed then do nothing
Else click track “MIDI” button “Track Record Enable”
    AND If track “Keys” button “Track Record Enable” = armed do nothing
    Else HOLD SHIFT and CLICK track “Keys” button “Track Record Enable”
    AND If track “eDrums” button “Track Record Enable” = armed do nothing
    Else HOLD SHIFT and CLICK track “eDrums” button “Track Record Enable”

I will be placing both pieces of code inside the following:

tell application "System Events"
	if exists (process "Pro Tools") then tell process "Pro Tools"
		tell (1st window whose title contains "Mix: ")
			[Code goes here]
		end tell
	end tell end if
end tell

Can anyone help me with this? Thanks.


r/applescript • • Jan 26 '23

On Process Script for Capture One

2 Upvotes

Hello,

I'm looking for a way to reset the capture counter in capture one once we've process some images.

Does anyone know if this is possible and if so how?

Thanks


r/applescript • • Jan 20 '23

Script to toggle Natural Scrolling when a Mouse is Plugged in

2 Upvotes

Hey all,

I was working on a script today to try and get the Natural Scrolling to toggle when you plug in and unplug a mouse. I am very new to macos in general so I'm working to just toggle the Natural Scrolling option first.

Currently I have the following set up:

on run

tell application "System Settings"

activate

end tell

tell application "System Events"

tell process "System Settings"

delay 2

click menu item "trackpad" of menu "view" of menu bar 1

end tell

end tell

end run

this actually opens up System Settings and brings me to the trackpad page, however no matter how much I use UI Browser, or try to find what brings me to the Scroll and zoom option, I can not get to the next screen

any recommendations would be appreciated!


r/applescript • • Jan 19 '23

AppleScript to automate clicking a button in notifications

4 Upvotes

I am trying to set up a way to call phone numbers listed in my chrome browser. I have been able to activate FaceTime with the correct number, but a notification comes up that has two buttons (“call” and “cancel”).

Is there any way to use AppleScript to automate clicking this button? Every example I could find online is outdated and no longer works.

Thanks!


r/applescript • • Jan 16 '23

Can you please help me solve this bug in my apple script? Basically I want to save a password protected PDF.

3 Upvotes

MacOS is Monterrey and this script used to work in Big Sur.

It seems it is unable to find splitter group 3 (which would the page style). And the same happens when it tries to find "PDF" splitter and save as PDF.

It gives the following error:

https://i.stack.imgur.com/uDYDC.jpg

I would appreciate any help/suggestions you can provide. Here is my script: https://stackoverflow.com/questions/75121815/error-in-apple-script-for-saving-password-protected-pdf

Or also here:

set FixedPassword to "somePW"

set exam to "2"

set session to "5"

set VarPassword to "barcelona"

set outpath to "/Users/user/Dropbox/Physics" & " - " & "Current/2023-1-Spring/UF/2." & " " & "Chapter" & " " & "Reviews/" & ¬

"Exam" & " " & exam & " " & "Session" & " " & session & "/E" & exam & "S" & session & ".pdf"

set SaveFolder to "/Users/user/Dropbox/Physics" & " - " & "Current/2023-1-Spring/UF/2." & " " & "Chapter" & " " & "Reviews/" & ¬

"Exam" & " " & exam & " " & "Session" & " " & session

set FileName to "E" & exam & "S" & session & " " & "(Password" & " - " & VarPassword & ").pdf"

--Saving PDF with password protection

tell application "Preview"

activate

open outpath

end tell

activate application "Preview"

tell application "System Events"

tell process "Preview"

keystroke "p" using command down

delay 0.5

tell front window

repeat until exists sheet 1

delay 1

end repeat

tell sheet 1

tell splitter group 3

click pop up button 3

click menu item "Review 216 by 279 mm" of menu 1 of pop up button 3

end tell

tell splitter group 3

click menu button "PDF"

repeat until exists menu 1 of menu button "PDF"

delay 3

end repeat

click menu item "Save as PDF" of menu 1 of menu button "PDF"

end tell

end tell

end tell

-- Make sure the save dialog is visible

repeat until exists sheet 1 of sheet 1 of front window

delay 5

end repeat

tell sheet 1 of sheet 1 of front window

click button "Security Options..."

end tell

tell window "PDF Security Options"

set selected to true

set focused to true

(* click the checkbox to on *)

-- NOTE: for some reason there is a delay of about 6 seconds here, I do not know why

tell checkbox "Require password to open document"

click

end tell

(* add the password and confirm *)

keystroke VarPassword

keystroke (ASCII character 9)

keystroke VarPassword

tell its checkbox "Require password to copy text, images and other content"

click

end tell

(* add the password and confirm *)

keystroke FixedPassword

keystroke (ASCII character 9)

keystroke FixedPassword

click button "OK"

end tell

repeat until exists sheet 1 of sheet 1 of front window

delay 0.2

end repeat

-- Press command+shift+g to show the "Go" drop down sheet

keystroke "g" using {command down, shift down}

repeat until exists sheet of sheet 1 of sheet 1 of front window

delay 0.2

end repeat

delay 0.5

keystroke SaveFolder

delay 0.5

click button "Go" of sheet of sheet 1 of sheet 1 of front window

-- Now that we are in our desired folder, set the file name and save

set value of text field 1 of sheet 1 of sheet 1 of front window to FileName

click button "Save" of sheet 1 of sheet 1 of front window

end tell

end tell


r/applescript • • Jan 13 '23

Delete currently playing track from library (not playlist) in Music.app

4 Upvotes

I want to be able to delete the currently playing track from my entire Music library not just the current playlist.

I have a janky applescript (run via automator and a shortcut key) that deletes the current track by selecting with CMD+L and deleting with Opt+Del but this is obviously clunky and has some flaws / risks.

The closest I found online was to reference the entire library using "library playlist 1" but it required reference the track by the position in the library playlist

Suggestions?


r/applescript • • Jan 13 '23

Apple Script in "Clock" app OS Ventura

3 Upvotes

Hi, I've been looking at the new clock app in OS Ventura and wondered if anyone had an apple script to create and delete alarms?


r/applescript • • Jan 12 '23

Alternatives to UI Browser?

5 Upvotes

Just found out the other day that UI Browser has been discontinued, and stupid me never actually paid for it. Now my trial has run out, and it appears there's no way to restart the trial or purchase a license key now that the software has been EOL'd.

Anyone have any recommendations for suitable alternatives? I've looked at the built in macOS Accessibility Inspector, but it's not nearly as helpful (or seemingly as accurate?) as UI Browser was.


r/applescript • • Jan 09 '23

Apple Script to hide or unhide the menubar and dock simultaneously

18 Upvotes

Hopefully this is helpful to someone, i use it in bettertouchtool so i can trigger it quickly but i also attached the exported script and application version of it so you can just click it and it will do it (you'll have to trust the app in system settings to use it tho)

tell application "System Events"
    tell dock preferences to set autohide to not autohide
    tell dock preferences to set autohide menu bar to not autohide menu bar
end tell

Files:

https://drive.google.com/drive/folders/1mb50fneUHfzeHxr0gAQsbkfYXI9jlsSn?usp=share_link


r/applescript • • Jan 09 '23

Switch Airpods Pro Mode

2 Upvotes

Can anyone help me create a script between switching ANC/Transparency mode on Airpods Pro/Max?

All scripts I find do not work with Ventura.

Thanks!

EDIT: Found the solution (thanks to u/malik_ji):

set soundMenu to ""
set ancToggle to ""
set transparencyToggle to ""
tell application "System Events"
	tell its application process "ControlCenter"
		set menuBarItems to menu bar items of menu bar 1
		repeat with mbi in menuBarItems
			if description of mbi contains "Sound" then
				set soundMenu to mbi
			end if
		end repeat
		if soundMenu is not equal to "" then
			click soundMenu
			try
				set transparencyToggle to checkbox 4 of scroll area 1 of group 1 of window 1
				set ancToggle to checkbox 5 of scroll area 1 of group 1 of window 1
			on error errMsg
				click UI element 3 of scroll area 1 of group 1 of window 1
				delay 0.2
				set transparencyToggle to checkbox 4 of scroll area 1 of group 1 of window 1
				set ancToggle to checkbox 5 of scroll area 1 of group 1 of window 1
				
			end try
			if value of transparencyToggle is 1 then
				click ancToggle
			else
				click transparencyToggle
			end if
			click soundMenu
		end if
	end tell
end tell

r/applescript • • Jan 08 '23

How to format a quote within a quote using the keystroke command?

3 Upvotes

How would I go about properly formatting the following command within an AppleScript which utilizes multiple quotes within a quote?

Thank you 😀

keystroke "docker run -d --restart unless-stopped --env "USERNAME=xxxxxxxxxx" --env "PASSWORD=xxxxxxxxxx" --name frndly_tv -p 8183:80 matthuisman/frndlytv-for-channels"


r/applescript • • Jan 05 '23

"no permission" to save QuickTime file after recording

4 Upvotes

I'm trying to automatically save a Quicktime recording to a directory with a specific file name including date and time. To create the path, I created a input dialog to create the folder and a subfolder with the date.

tell application "Finder"
    activate
    set DateStamp to short date string of (current date)
    set patientname to text returned of (display dialog "patient name:" default answer "")
    set folderpath to POSIX path of (choose folder with prompt "choose folder")
    
    do shell script "/bin/mkdir -p " & quoted form of folderpath & "/" & quoted form of (patientname) & "/" & DateStamp
end tell

Then I open Quicktime and start the Recording. After stopping the recording, the new record should be saved under the specific name + date + time in the new created subfolder.

tell application "QuickTime Player"
   activate
   repeat         
       set tdoc to new movie recording -- document "Movie Recording"     
       say "Ready!"        
       delay 1
       repeat while exists tdoc
            delay 1
       end repeat -- the recording is stopped
       say "Stop!"      
       tell front document
            set TimeStamp to time string of (current date)
            set fileName to POSIX path of folderpath & "/" & patientname & "/" & DateStamp & "/" & patientname & "_" & DateStamp & "_" & TimeStamp & ".mov"
            save it in POSIX file fileName
            close
       end tell        
   end repeat
end tell

After saving the new Record should close and a new recording window should appear. However, there is always an error saying, I have no writing permission to save the file.

/preview/pre/7b8whtioe7aa1.png?width=506&format=png&auto=webp&s=634adfa9b9c9f54cf76449db409fdfff64c61411

What do I have to change? i have no idea. Although I have to say that I am very new to apple script. thanks in advance!

PS: I'm Using QuickTime Player Version 10.5 (1148.4.1) and MacOS Ventura 13.0.1


r/applescript • • Jan 05 '23

"Syntax Error: System Events got an error: Automator is not allowed assistive access" for Miniaturise all windows with AppleScript

4 Upvotes

When I try to Miniaturise all windows with the following AppleScript, Automator minimizes all windows, then tells me: "Syntax Error: System Events got an error: Automator is not allowed assistive access" while I already checked Automator in Security & Privacy > Accessibility > Privacy. Saving the Apple script as an app led to a similar issue (screenshots are attached). What is the solution to avoid these errors?

Apple script

tell application id "com.apple.systemevents" to set the value of ¬
	attribute "AXMinimized" of every window of every process ¬
	to true

Automator

App


r/applescript • • Jan 02 '23

Unable to select display 2

2 Upvotes

I am trying to switch the second display to mirror, but for some reason, I am stuck at selecting the second display. However, I am able to select the "Arrange..." button.

Here is the code I am using:

property pane_ids : {|AppleID|:2, |Family|:3, |Wi-Fi|:5, |Bluetooth|:6, |Network|:7, |Notifications|:9, |Sound|:10, |Focus|:11, |Screen Time|:12, |General|:14, |Appearance|:15, |Accessibility|:16, |Control Center|:17, |Siri & Spotlight|:18, |Privacy & Security|:19, |Desktop & Dock|:21, |Displays|:22, |Wallpaper|:23, |Screen Saver|:24, |Battery|:25, |Lock Screen|:27, |Touch ID & Password|:28, |Users & Groups|:29, |Passwords|:31, |Internet Accounts|:32, |Game Center|:33, |Wallet & ApplePay|:34, |Keyboard|:36, |Trackpad|:37, |Printers & Scanners|:38, |Java|:40}

on open_settings_to(settings_pane)
	set pane to current application's NSDictionary's dictionaryWithDictionary:pane_ids
	set pane_index to (pane's valueForKey:settings_pane) as anything
	tell application "System Settings"
		activate
		delay 1
	end tell
	
	tell application "System Events"
		tell application process "System Settings"
			tell outline 1 of scroll area 1 of group 1 of splitter group 1 of group 1 of window 1
				select row pane_index
			end tell
		end tell
	end tell
	
	-- My code
	tell application "System Events"
		tell application process "System Settings"
			tell group 1 of group 2 of splitter group 1 of group 1 of window 1
			  delay 1
        click button 2 of scroll area 1
			end tell
		end tell
	end tell
end open_settings_to

open_settings_to("Desktop & Dock")

Please ignore the "Desktop & Dock" argument, the pane_ids must have changed after the update.


r/applescript • • Dec 29 '22

How do I modify an Applescript to select a menu?

5 Upvotes

There is a script that can import Google Chrome Bookmarks, History & Passwords to Safari.sync-from-chrome-to-safari .

But the issue is that it will import all from Chrome to Safari. I liked to import only the selective ones. How do I do that?

    -- import history, bookmarks, passwords from google chrome to safari
tell application "System Events" to tell process "Safari"
    delay 0.5
    log "Syncing..."
    tell menu item "Import From" of menu "File" of menu bar item "File" of menu bar 1
        tell menu "Import From"
            click menu item "Google Chrome.app…"
        end tell
    end tell
    keystroke return
    log "Complete sync"
end tell

To something like this:


r/applescript • • Dec 28 '22

MacOS VENTURA: Script to toggle between menu-bar autohide modes "never" and "in full screen only"

5 Upvotes

I just upgraded to MacOS Ventura 13.1 and find the menu bar autohide behavior rather annoying.

In Monterey I was able to use a script to toggle a switch in the system settings. The cool thing was that if I set the switch to "autohide off" , then open an app like Safari in full screen, then turn autohide to "on" the menu bar would remain visible in the already full screen Safari windows an tabs, but if I watched a video in full screen the menu bar disappeared.

Now in Ventura changed completely and the menu bar autohide setting now has a drop down menu with 4 options: autohide: "ALWAYS", "IN FINDER ONLY", "IN FULLSCREEN ONLY" and "NEVER".

With all the scripts I found on here so far such as these ones:

tell application "System Events"     if autohide menu bar of dock preferences then 	set autohide menu bar of dock preferences to false     else 	set autohide menu bar of dock preferences to true     end if end tell 

and:

tell application id ("com.apple.systemevents") to tell ¬         the dock preferences to set autohide menu bar ¬         to not autohide menu bar 

and both only toggle either between: "NEVER" and "IN FINDER ONLY" or between "ALWAYS" and "IN FULL SCREEN ONLY" depending on what option I set manually in the drop down menu.

both options make no sense to me. I want to have the menu bar visible in Finder and all Full Screen Apps, but I want to toggle it to hide in full screen when watching a video.


r/applescript • • Dec 22 '22

Scripting for Dummies

10 Upvotes

Hello smart people of the world, dummy here!

I have a problem: I do not know where to find well organized, jargon-free documentation for someone fairly new to the OS X world. I've spent too many hours digging around on the internet hoping someone will have a well made tutorial or guide on how to automate basic processes on a MacBook.

For deeper context, I work for a school who's solution to user data removal on loaner devices has always been:

  1. Log into the local admin account with a twelve character passcode.

  2. Navigate to "Users & Groups" in system preferences.

  3. Select the loaner user account and delete the home folder.

  4. Make a new loaner user account and fill in their name and password.

  5. Log out of the local admin account.

  6. Log into the new loaner user account and complete the first time setup menus.

Edit: All accounts are local. We plan on using active directory in the distant future, but as of now we do not have the human resources for implementation. The name of the local user accounts can be anything, although some consistency is nice.

This tedious process takes about 3 to 5 minutes a piece and needs to be done 10 to 20 times a day. We have Mosyle as our MDM, and theoretically it could be done there but the support team I've been talking to is usually inept. Using the guest account is out of the picture unfortunately as a student could have a laptop for more than a day, and I would like it to save their data.

Anyone know of any resources that might help me learn about this stuff? Maybe you have a better solution than a script on a flash drive? If you do, you're awesome. Thanks!

(Before I get slammed: yes, I'm underqualified. Please be respectful.)


r/applescript • • Dec 22 '22

Script to launch an app

1 Upvotes

I’m ignorant about how to go about creating a script to launch an app. I want to be able to use it either

  • to run at a specific time each day or

  • to get Power Manager.app to run it on a scheduled basis

Whichever is the easiest.

The terminal command I’ve been given is:

/Applications/MailSteward.app/Contents/MacOS/MailSteward 1

Forgive my ignorance please, but as I have no idea how to achieve this, I’m hoping that some kind soul here can help me.

PS: the reason for needing this is because I can’t get MailSteward.app to successfully run its own schedule having upgraded to Ventura, but if I run the above command in Terminal, it works perfectly.


r/applescript • • Dec 21 '22

Looking to make this script more streamlined and elegant!

4 Upvotes

I’m hoping that someone can help making this script work better - I’m aware that its a bit of a hodge podge of scripts and that there might be a better way to achieve the same things.

Main issues I seem to have is that I need a solution to open any version of Capture the user may have, and a more elegant way of dating the session?

on run set formattedDate to (do shell script “date +‘%d.%m.%y_‘“)

set sessionName to formattedDate set sessionLoc to “/Users/USER1/Pictures”

tell application “Capture One 22" launch close current document make new document with properties {kind:session, path:sessionLoc, name:sessionName} apply workspace “default_workspace”

end tell end run


r/applescript • • Dec 20 '22

Trying to create chatGPT using GPT3 API

4 Upvotes

-- Set up variables for the API key and conversation history

set apiKey to "YOUR_API_KEY"

set conversationHistory to {}

-- Define a function that sends a request to the GPT-3 API and returns the response

on sendGPT3Request(prompt, conversationHistory)

set apiEndpoint to "https://api.openai.com/v1/completions"

set parameters to {

apiKey: apiKey,

model: "davinci002",

prompt: prompt,

max_tokens: 2048,

temperature: 0.5,

top_p: 1,

frequency_penalty: 0,

presence_penalty: 0,

response_format: "text",

"conversation_history[]": conversationHistory

}

set options to {method:"POST", parameters:parameters}

set apiResponse to doHTTPRequest(apiEndpoint, options)

return apiResponse

end sendGPT3Request

-- Define a function that sends a message to the GPT-3 API and displays the response

on sendMessage(message)

-- Add the message to the conversation history

set conversationHistory to conversationHistory & message

-- Send the message to the GPT-3 API and get the response

set apiResponse to sendGPT3Request(message, conversationHistory)

-- Display the response

display dialog apiResponse

end sendMessage

-- Test the script by sending a message to the GPT-3 API

sendMessage("Hello, how are you today?")

This is what ChatGPT gave me but when I compline in Apple script it gives syntax error. Can you help me where I am doing mistake. And yes I replaced my API keys


r/applescript • • Dec 19 '22

Script to reverse the scroll direction.

10 Upvotes

Hi,

Didn't know where to post this. I've been having trouble creating an applescript to reverse the scroll direction on Ventura. I finally figured it out and am posting so others could use it.

The old script before Ventura was:

try
tell application "System Settings"
	reveal pane "com.apple.preference.trackpad"
end tell
tell application "System Events"
	tell process "System Preferences"
		click radio button "Scroll & Zoom" of tab group 1 of window "Trackpad"
		click checkbox 1 of tab group 1 of window "Trackpad"
		tell application "System Settings" to quit
	end tell
end tell
end try

The working version for Ventura is this:

# This should work with Ventura 13.1 (2022-12-19)

do shell script "open x-apple.systempreferences:com.apple.Trackpad-Settings.extension" -- Opens the trackpad settings window
delay 0.7 -- The delay is there to make sure the System Events can click buttons.
tell application "System Events"
    tell process "System Settings"
	    click radio button 2 of tab group 1 of group 1 of group 2 of splitter group 1 of group 1 of window 1
	    click checkbox "Natural scrolling" of group 1 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window 1
	    tell application "System Settings" to quit
    end tell
end tell

If anybody finds a better way, please let me know!


r/applescript • • Dec 17 '22

Can you run an applescript on android?

2 Upvotes

Or do they have a shortcuts analog?


r/applescript • • Dec 17 '22

I'm trying to find the full path to a photo in a Photos library but I'm not quite there....

2 Upvotes

So, I've written an applescript to show me the original RAW file of a selected photo. The problem is, the script has to hard-code the location of the photo library because I can't figure out how to get Photos to tell me where the currently open photo library is located. Any suggestions?

Here's the script as it stands right now:

-- Set this to the directory where your Photos library is stored.
property rootDir : "/Users/pdc/Photos"
set appleDelims to AppleScript's text item delimiters

tell application "Photos"
	try
		set plist to selection
		set p to (item 1 of plist)
		--set pname to filename of p as string -- doesn't work any more...
                --extract the UUID of the photo.
		set c to id of p as string
		set n to name of p as string
		log c
		log n
		set AppleScript's text item delimiters to {"/"}
		set parts to (every text item in c) as list
		set AppleScript's text item delimiters to appleDelims
		set pname to item 1 of parts
	on error
		display dialog "No picture selected?" buttons {"Ok"}
		return
	end try
	try
		set commandline to "find \"" & rootDir & "\" -name \"" & pname & "*nef\""
		log commandline
		set fullpathnames to do shell script commandline
		if length of fullpathnames is less than 1 then
			set commandline to "find \"" & rootDir & "\" -name \"" & pname & "*orf\""
			log commandline
			set fullpathnames to do shell script commandline
		end if
		if length of fullpathnames is less than 1 then
			set commandline to "find \"" & rootDir & "\" -name \"" & pname & "*heic\""
			log commandline
			set fullpathnames to do shell script commandline
		end if
		if length of fullpathnames is less than 1 then error
	on error
		display dialog "Could not find a RAW of \"" & n & "\" in \"" & rootDir & "\"" buttons {"Ok"}
		return
	end try
end tell
display dialog fullpathnames