I have encountered the same problem on Ventura 13.0.1. As a workaround I've used DiskArbitration, which seems to report file system correctly:
#include <DiskArbitration/DiskArbitration.h>
DASessionRef session = DASessionCreate(kCFAllocatorDefault);
CFURLRef mpURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/Volumes/NO NAME/"), kCFURLPOSIXPathStyle, YES);
DADiskRef diskRef = DADiskCreateFromVolumePath(kCFAllocatorDefault, session, mpURL);
CFDictionaryRef description = DADiskCopyDescription(diskRef);
NSDictionary* diskInfo = (__bridge NSDictionary *)description;
NSLog(@"%@", [diskInfo valueForKey:@"DAVolumeKind"]);
Post
Replies
Boosts
Views
Activity
Something like this?
tell application "Keynote"
activate
tell front document
tell the first slide
set mytitlename to object text of default title item
end tell
end tell
end tell
It looks like Visual Studio Code doesn't have an AppleScript dictionary, so perhaps use System Events?
tell application "System Events"
tell process "Code"
-- selecting window to raise by its title, modify as needed
set w to item 1 of (windows whose title is "Untitled-1")
perform action "AXRaise" of item 1 of w
end tell
activate application "Visual Studio Code"
end tell
I have an app which main binary has no latin characters whatsoever and it just got notarized correctly with notarytool (macOS 13.2.1, XCode 14.2), I don't think it's an encoding issue.
Have you installed XQuartz? It looks like this package needs some X11 libraries.
You are not addressing some generic "window" class, but different "window" classes belonging to a different processes, which just happen to have the same name. They may have different properties and actions. Take a look at those applications' respective dictionaries (cmd+shift+o in the Script Editor) and you'll notice "miniaturized" is in Safari dictionary, but not in Finder dictionary, for example. You can have consistency across the applications if you use "System Events" to minimize the windows:
tell application "System Events" to set the value of attribute "AXMinimized" of window 1 of process "Finder" to true
Go to Xcode settings -> Locations -> Advanced.
When syncing to FAT file systems, --modify-window=1 is recommended, see man rsync for this option.
I would suggest utilising AppleScript to do it. In Shortcuts you can add the action "Run Applescript" to change directory before calling python script. See the following example:
on run {input, parameters}
set mPath to ""
try
tell application "Finder" to set mPath to quoted form of POSIX path of ((get target of front window) as alias)
end try
set outputString to do shell script "cd " & mPath & "; python3 -c 'import os; print(os.getcwd())'"
return outputString
end run
You can also execute AppleScript commands directly from Python using osascript:
import subprocess
subprocess.run(['/usr/bin/osascript', '-e', 'try', '-e', 'tell application "Finder" to set mPath to quoted form of POSIX path of ((get target of front window) as alias)', '-e', 'end try'])
It would be much easier to debug if you provided your document, your explanation of what you are trying to achieve is not super clear to me. I assume you start with no data in sheet 2 and you don't care that I'm overwriting data in sheet 2 - is this true? Anyway, please go through this code and read the comments. It takes maybe 2-3 minutes on my computer to finish the script.
tell application "Numbers"
activate
-- the following code is just to show you how do I think your document looks like
make new document
tell front document
-- there should already be one sheet, let's rename it to GAMES
set name of active sheet to "GAMES"
-- create sheet TRIALS2
-- this should also create table 1
make new sheet
set name of active sheet to "TRIALS2"
-- making sure table 1 has at least 67 rows, otherwise we cannot access row 67
if (row count of table 1 of sheet "GAMES" < 67) then
set row count of table 1 of sheet "GAMES" to 67
end if
-- making sure table 1 has at least 2 columns, otherwise we cannot access column B
if (column count of table 1 of sheet "GAMES" < 2) then
set column count of table 1 of sheet "GAMES" to 2
end if
-- inserting some value into cell B67
set value of cell "B67" of table 1 of sheet "GAMES" to random number
end tell
-- this is when to start if you already have "GAMES" and "TRIALS" set up
tell front document
-- we need 2003 rows because we do 2000 repeats
set row count of table 1 of sheet "TRIALS2" to 2003
repeat with rowNumber from 3 to 2003
-- copy value of one cell to another
-- target for copy operation is cell A3, A4, A5...A2003
set value of cell ("A" & (rowNumber as text)) of table 1 of sheet "TRIALS2" to (value of cell "B67" of table 1 of sheet "GAMES")
-- generate new random value in cell B67
set value of cell "B67" of table 1 of sheet "GAMES" to random number
end repeat
end tell
end tell