AppStore

[AppStore]アップデートページを開く


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

set strBundleID to ("com.apple.AppStore") as text
###オープンするURL
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("macappstore")
ocidURLComponents's setHost:("showUpdatesPage")
ocidURLComponents's setPath:("")
set ocidURL to (ocidURLComponents's |URL|())
set strURL to ocidURL's absoluteString() as text
log strURL
-->(*macappstore://showUpdatesPage*)
###起動
tell application id strBundleID to launch
###起動待ち 最大10秒
repeat 10 times
  tell application id strBundleID to activate
  tell application id strBundleID
    set boolFrontMost to frontmost as boolean
  end tell
  if boolFrontMost = false then
    delay 0.5
  else
    exit repeat
  end if
end repeat
###URLを開く
tell application id strBundleID
  open location strURL
end tell




|

[AppStore]ストーリーページを開く


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application


set strBundleID to ("com.apple.AppStore") as text
###オープンするURL
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("macappstore")
ocidURLComponents's setHost:("showPurchasesPage")
ocidURLComponents's setPath:("")
set ocidURL to (ocidURLComponents's |URL|())
set strURL to ocidURL's absoluteString() as text
log strURL
-->(*macappstore://showPurchasesPage*)
###起動
tell application id strBundleID to launch
###起動待ち 最大10秒
repeat 10 times
  tell application id strBundleID to activate
  tell application id strBundleID
    set boolFrontMost to frontmost as boolean
  end tell
  if boolFrontMost = false then
    delay 0.5
  else
    exit repeat
  end if
end repeat
###URLを開く
tell application id strBundleID
  open location strURL
end tell




|

[AppStore]アカウントページを開く


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application


set strBundleID to ("com.apple.AppStore") as text
###オープンするURL
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("macappstore")
ocidURLComponents's setHost:("showPurchasesPage")
ocidURLComponents's setPath:("")
set ocidURL to (ocidURLComponents's |URL|())
set strURL to ocidURL's absoluteString() as text
log strURL
-->(*macappstore://showPurchasesPage*)
###起動
tell application id strBundleID to launch
###起動待ち 最大10秒
repeat 10 times
  tell application id strBundleID to activate
  tell application id strBundleID
    set boolFrontMost to frontmost as boolean
  end tell
  if boolFrontMost = false then
    delay 0.5
  else
    exit repeat
  end if
end repeat
###URLを開く
tell application id strBundleID
  open location strURL
end tell




|

[AppStore]ストアトップページを開く


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
itunes.apple.comのlookupについてはこちらを
https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-623246.html
*)
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application
####設定項目


set strBundleID to ("com.apple.AppStore") as text
###オープンするURL
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("macappstore")
ocidURLComponents's setHost:("itunes.apple.com")
set ocidURL to (ocidURLComponents's |URL|())
set strURL to ocidURL's absoluteString() as text
log strURL
-->(*macappstore://itunes.apple.com*)
###起動
tell application id strBundleID to launch
###起動待ち 最大10秒
repeat 10 times
  tell application id strBundleID to activate
  tell application id strBundleID
    set boolFrontMost to frontmost as boolean
  end tell
  if boolFrontMost = false then
    delay 0.5
  else
    exit repeat
  end if
end repeat
###URLを開く
tell application id strBundleID
  open location strURL
end tell




|

[AppStore]アーティスト・デベロッパーページを開く


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
itunes.apple.comのlookupについてはこちらを
https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-623246.html
*)
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application
####設定項目
set strAppID to ("id1219074513") as text


set strBundleID to ("com.apple.AppStore") as text
###オープンするURL
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("macappstore")
ocidURLComponents's setHost:("itunes.apple.com")
set strPath to ("/artist/" & strAppID) as text
ocidURLComponents's setPath:(strPath)
set ocidURL to (ocidURLComponents's |URL|())
set strURL to ocidURL's absoluteString() as text
log strURL
-->(*macappstore://itunes.apple.com/artist/id1219074513*)
###起動
tell application id strBundleID to launch
###起動待ち 最大10秒
repeat 10 times
  tell application id strBundleID to activate
  tell application id strBundleID
    set boolFrontMost to frontmost as boolean
  end tell
  if boolFrontMost = false then
    delay 0.5
  else
    exit repeat
  end if
end repeat
###URLを開く
tell application id strBundleID
  open location strURL
end tell




|

[AppStore]IDからWEBページを開く


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
itunes.apple.comのlookupについてはこちらを
https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-623246.html
サンプル
trackName: Linearity Curve Graphic Design
trackId: 1219074514
bundleId: com.linearity.vn
version: 5.0.2
artistId: 1219074513
artistName: Linearity GmbH
macappstores://itunes.apple.com/app/id1219074514
https://apps.apple.com/app/apple-store/id1219074514

https://developer.apple.com/library/archive/qa/qa1633/_index.html
*)
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

set strTrackId to ("1219074514") as text

###オープンするURL
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("https")
ocidURLComponents's setHost:("apps.apple.com")
##英語の場合は
##ocidURLComponents's setPath:("/app/id" & strTrackId")
##日本語の場合
##ocidURLComponents's setPath:("/jp/app/apple-store/id" & strTrackId")
ocidURLComponents's setPath:("/jp/app/id" & strTrackId)

###
set ocidQueryItemMT to refMe's NSURLQueryItem's alloc()'s initWithName:("mt") value:("12")
(*
1 Music
2 Podcasts
3 Audiobooks
4 TV Shows
5 Music Videos
6 Movies
7 iPod Games
8 Mobile Software Applications
9 Ringtones
10 iTunes U
11 E-Books
12 Desktop Apps
*)
##AppStoreを起動させない 1で起動
set ocidQueryItemLS to refMe's NSURLQueryItem's alloc()'s initWithName:("ls") value:("0")
ocidURLComponents's setQueryItems:({ocidQueryItemMT, ocidQueryItemLS})
##ocidURLComponents's setQuery:("mt=12&ls=0")
##
set ocidURL to (ocidURLComponents's |URL|())
set strURL to ocidURL's absoluteString() as text
log strURL
-->(*macappstore://showUpdatesPage*)

###起動 Finder-->デフォルトのブラウザで
set strBundleID to ("com.apple.finder") as text
tell application id strBundleID to launch
###起動待ち 最大10秒
repeat 10 times
  tell application id strBundleID to activate
  tell application id strBundleID
    set boolFrontMost to frontmost as boolean
  end tell
  if boolFrontMost = false then
    delay 0.5
  else
    exit repeat
  end if
end repeat
###URLを開く
tell application id strBundleID
  open location strURL
end tell




|

[AppStore]アプリケーションページを開く


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
(*
itunes.apple.comのlookupについてはこちらを
https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-623246.html
スキームは4種類
macappstore://itunes.apple.com/app/id1219074514
macappstores://itunes.apple.com/app/id1219074514
itms-appss://itunes.apple.com/app/id1219074514
itms-apps://itunes.apple.com/app/id1219074514
*)
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application
####設定項目
set strAppID to ("id1219074514") as text

set strBundleID to ("com.apple.AppStore") as text
###オープンするURL
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
ocidURLComponents's setScheme:("macappstore")
ocidURLComponents's setHost:("itunes.apple.com")
set strPath to ("/app/" & strAppID) as text
ocidURLComponents's setPath:(strPath)
set ocidURL to (ocidURLComponents's |URL|())
set strURL to ocidURL's absoluteString() as text
log strURL
-->(*macappstore://itunes.apple.com/app/id1219074514*)
###起動
tell application id strBundleID to launch
###起動待ち 最大10秒
repeat 10 times
  tell application id strBundleID to activate
  tell application id strBundleID
    set boolFrontMost to frontmost as boolean
  end tell
  if boolFrontMost = false then
    delay 0.5
  else
    exit repeat
  end if
end repeat
###URLを開く
tell application id strBundleID
  open location strURL
end tell




|

[JSON]App Store Lookupデータから各種情報を取得する


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
# https://apps.apple.com/us/genre/ios/id36
(*
SafariでWEBページ表示中のアプリケーションのID情報を
lookup JSONから取得します

*)
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application
set strBundleID to "com.apple.Safari" as text
################################
tell application "Safari"
  set numCntWindow to (count of every window) as integer
  if numCntWindow = 0 then
return "ウィンドウがありません"
  end if
end tell

###サファリの最前面のURL
tell application "Safari"
  set numID to id of front window
  set objTab to current tab of window id numID
  tell window id numID
    tell objTab
      set strURL to URL
    end tell
  end tell
end tell
################################
set strURL to strURL as text
set ocidURLString to refMe's NSString's stringWithString:(strURL)
set ocidURL to refMe's NSURL's alloc()'s initWithString:(ocidURLString)
###
set strHostName to ocidURL's |host|() as text
if strHostName is not "apps.apple.com" then
  set strOpenURL to "https://apps.apple.com/us/genre/ios/id36"
  tell application "Safari"
    open location strOpenURL
  end tell
return "ID取得出来ません"
end if
###ラストパス から デベロッパIDを取得する
set strLastPath to (ocidURL's lastPathComponent()) as text
set ocidLastPath to refMe's NSString's stringWithString:(strLastPath)
set ocidID to ocidLastPath's stringByReplacingOccurrencesOfString:("id") withString:("")
set strIDno to ocidID as text

###データ取得用のURLに整形
set strLookupURL to ("https://itunes.apple.com/lookup?id=" & strIDno & "") as text
set ocidLookup to refMe's NSString's stringWithString:(strLookupURL)
set ocidLookupURL to refMe's NSURL's alloc()'s initWithString:(ocidLookup)
log ocidLookupURL's absoluteString() as text
####JSON
set listReadData to refMe's NSData's alloc()'s initWithContentsOfURL:(ocidLookupURL) options:(refMe's NSDataReadingMappedIfSafe) |error|:(reference)
set coidReadData to item 1 of listReadData
###NSJSONSerialization
set listJSONSerialization to (refMe's NSJSONSerialization's JSONObjectWithData:(coidReadData) options:(refMe's NSJSONReadingMutableContainers) |error|:(reference))
set ocidJsonData to item 1 of listJSONSerialization
###
set ocidJsonDict to refMe's NSDictionary's alloc()'s initWithDictionary:(ocidJsonData)
set ocidResultsArray to ocidJsonDict's valueForKey:("results")
set ocidResultsDict to ocidResultsArray's firstObject()
## set listKeys to ocidResultsDict's allKeys()
set listKeys to {"primaryGenreName", "artworkUrl100", "currency", "sellerUrl", "artworkUrl512", "ipadScreenshotUrls", "fileSizeBytes", "genres", "languageCodesISO2A", "artworkUrl60", "supportedDevices", "trackViewUrl", "description", "bundleId", "version", "artistViewUrl", "userRatingCountForCurrentVersion", "isGameCenterEnabled", "appletvScreenshotUrls", "genreIds", "averageUserRatingForCurrentVersion", "releaseDate", "trackId", "wrapperType", "minimumOsVersion", "formattedPrice", "primaryGenreId", "currentVersionReleaseDate", "userRatingCount", "artistId", "trackContentRating", "artistName", "price", "trackCensoredName", "trackName", "kind", "features", "contentAdvisoryRating", "screenshotUrls", "releaseNotes", "isVppDeviceBasedLicensingEnabled", "sellerName", "averageUserRating", "advisories"} as list

repeat with itemKey in listKeys
  log (ocidResultsDict's valueForKey:(itemKey))
end repeat
set strTrackIName to (ocidResultsDict's valueForKey:("trackName")) as text
set strTrackId to (ocidResultsDict's valueForKey:("trackId")) as text
set strBundleID to (ocidResultsDict's valueForKey:("bundleId")) as text
set strVersion to (ocidResultsDict's valueForKey:("version")) as text
set strArtistId to (ocidResultsDict's valueForKey:("artistId")) as text
set strArtistName to (ocidResultsDict's valueForKey:("artistName")) as text

set strDefaultAnser to ("trackName: " & strTrackIName & "\r") as text
set strDefaultAnser to strDefaultAnser & ("trackId: " & strTrackId & "\r") as text
set strDefaultAnser to strDefaultAnser & ("bundleId: " & strBundleID & "\r") as text
set strDefaultAnser to strDefaultAnser & ("version: " & strVersion & "\r") as text
set strDefaultAnser to strDefaultAnser & ("artistId: " & strArtistId & "\r") as text
set strDefaultAnser to strDefaultAnser & ("artistName: " & strArtistName & "\r") as text


###ダイアログを出して
set aliasIconPath to POSIX file "/System/Applications/App Store.app/Contents/Resources/AppIcon.icns" as alias
set theResponse to 2 as number
try
  set recordResult to (display dialog "アプリ情報" with title "詳細情報" default answer strDefaultAnser buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 20 without hidden answer)
on error
  log "エラーしました"
return
end try
if true is equal to (gave up of recordResult) then
return "時間切れですやりなおしてください"
end if
if "OK" is equal to (button returned of recordResult) then
  set strResponse to (text returned of recordResult) as text
end if


###クリップボードコピー
if button returned of recordResult is "クリップボードにコピー" then
  set strText to text returned of recordResult as text
  ####ペーストボード宣言
  set appPasteboard to refMe's NSPasteboard's generalPasteboard()
  set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
end if


|

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat AddOn Acrobat Annotation Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat JS Acrobat Manifest Acrobat Menu Acrobat Open Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat python Acrobat Reader Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin Support Admin System Information Admin Tools Admin Users Admin Volumes Adobe Adobe FDKO Adobe RemoteUpdateManager AppKit Apple AppleScript AppleScript do shell script AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript System Events AppleScript System Events Plist AppleScript Video Applications AppStore Archive Attributes Automator BackUp Barcode Barcode QR Barcode QR Decode Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome CIImage CityCode CloudStorage Color com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Device Diff Disk Dock DropBox Droplet eMail Encode % Encode Decode Encode UTF8 Error EXIFData ffmpeg File Finder Firefox Folder FolderAction Fonts GIF github Guide HTML HTML Entity Icon Illustrator Image Events Image2PDF ImageOptim iPhone iWork Javascript Jedit Json Label Leading Zero List locationd LRC lsappinfo LSSharedFileList m3u8 Mail MakePDF Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Mouse Music NetWork Notes NSArray NSArray Sort NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSColor NSColorList NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSPrintOperation NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth OneDrive PDF PDFAnnotation PDFAnnotationWidget PDFContext PDFDisplayBox PDFDocumentPermissions PDFImageRep PDFKit PDFnUP PDFOutline perl Photoshop PlistBuddy pluginkit postalcode PostScript prefPane Preview Python QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver SF Symbols character id SF Symbols Entity sips Skype Slack Sound Spotlight sqlite SRT StandardAdditions Swift System Settings TCC TemporaryItems Terminal Text Text CSV Text MD Text TSV TextEdit Tools Translate Trash Twitter Typography UI Unit Conversion UTType valueForKeyPath Video VisionKit Visual Studio Code VMware Fusion Wacom webarchive webp Wifi Windows XML XML EPUB XML OPML XML Plist XML RSS XML savedSearch XML SVG XML TTML XML webloc XML XMP YouTube zoom