Menu

Skip to content
AppleScriptの穴
  • Home
  • Products
  • Docs
  • Events
  • Forum
  • About This Blog
  • License
  • 仕事依頼

AppleScriptの穴

Useful & Practical AppleScript archive. Click '★Click Here to Open This Script' Link to download each AppleScript

SafariでURLをローディング

Posted on 2月 6, 2018 by Takaaki Naganoya

本処理は最近のSafariでは正しくローディング検出できないようになってきたため、書き直したルーチン「SafariでURLローディング検出」を利用してください。

AppleScript名:SafariでURLをローディング
set aURL to "http://www.piyocast.com/as/"
–set aURL to ""

tell application "Safari"
  set d to count every window
  
if d = 0 then
    make new window
    
tell document 1
      set URL to aURL
    end tell
  else
    if aURL is not equal to "" then
      tell document 1
        set URL to aURL
      end tell
    end if
  end if
  
  
page_loaded(10) of me
  
  
set a to do JavaScript "document.title" in document 1
end tell

on page_loaded(timeout_value)
  repeat with i from 1 to (timeout_value * 10)
    tell application "Safari"
      if (do JavaScript "document.readyState" in document 1) is "complete" then
        return true
      else if i is the timeout_value then
        return false
      else
        delay 0.1
      end if
    end tell
  end repeat
  
return false
end page_loaded

★Click Here to Open This Script 

More from my site

  • 各種GUI要素なしでSafari上に新規ウィンドウ表示各種GUI要素なしでSafari上に新規ウィンドウ表示
  • YouTubeムービーの状態を取得、操作YouTubeムービーの状態を取得、操作
  • Safariで表示中のWebページの最終更新日時を取得Safariで表示中のWebページの最終更新日時を取得
  • OS X 10.11.5+Safari 9.1.1以降で、新たなAS制限機能が増えるOS X 10.11.5+Safari 9.1.1以降で、新たなAS制限機能が増える
  • Safariのダウンロードフォルダを求める v5Safariのダウンロードフォルダを求める v5
  • Safariで検索を実行Safariで検索を実行
Posted in JavaScript URL | Tagged 10.11savvy 10.12savvy 10.13savvy Safari | 2 Comments

2 thoughts on “<span>SafariでURLをローディング</span>”

  1. 2/6/18
    12:39 PM
    2018年2月6日
    12:39 PM

    Reply

    Safariの最前面のドキュメントのテキストを取得するv2 – AppleScirpt Hole says:

    […] 前の記事へ SafariでURLをローディング […]

  2. 8/10/20
    12:16 AM
    2020年8月10日
    12:16 AM

    Reply

    SafariでURLローディング検出 – AppleScriptの穴 says:

    […] Safari 13で従来どおり、do javascriptコマンド経由で、 […]

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'ZeroSpam\Modules\Comments\Comments' does not have a method 'enqueue_davidwalsh' in /home/piyomaru/piyocast.com/public_html/as/wp-includes/class-wp-hook.php on line 287

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

電子書籍(PDF)をオンラインストアで販売中!

Google Search

Popular Posts

  • Numbersで選択範囲のセルのデータを取得して重複データを抽出
  • 文字種類変換(ASOC)
  • 【基礎】AppleScriptの実行を(操作により)中断する
  • Keynoteで全スライドのタイトルアイテムの高さを統一
  • 文字置換 v2
  • Numbersで指定の2つの書類のデータのdiffを取る
  • JPEG画像の破損チェック
  • 文字エンコーディングを自動判別してファイル読み込み v1.2.1
  • Bluetoothデバイスのバッテリー残量を取得 v3
  • iCloud Driveフォルダへのパスを求める
  • Evernoteがv10.0でElectronベースのWebブラウザ的なアプリに
  • Script Debugger v8 日本語対応中
  • iTunesライブラリ中のアートワークをすべてJPEGで書き出し v2
  • 指定フォルダ内のファイルのうち、指定拡張子リストに入っているものをすべて取得してフルパスを返す
  • mouseClickを用いて指定座標をクリック
  • macOS 10.15beta関連
  • 指定フォルダ以下のすべてのファイルとフォルダ名から絵文字を除去する v2
  • 指定文字コードでファイル書き出し(UTF-8)v2
  • 指定名称のアプリケーションをフルスクリーン表示
  • Numbersの表を回転

Tags

10.11savvy (1109) 10.12savvy (1249) 10.13savvy (1389) 10.14savvy (514) 10.15savvy (305) 11.0savvy (114) CotEditor (48) Finder (43) iTunes (25) Keynote (62) NSAlert (59) NSAlertSecondButtonReturn (16) NSArray (50) NSBitmapImageRep (20) NSBundle (19) NSButton (33) NSColor (48) NSDictionary (26) NSFileManager (23) NSFont (18) NSImage (40) NSJSONSerialization (21) NSMutableArray (61) NSMutableDictionary (21) NSPredicate (36) NSRunningApplication (55) NSScreen (30) NSScrollView (22) NSString (114) NSURL (93) NSURLRequest (22) NSUTF8StringEncoding (30) NSUUID (18) NSView (33) NSWindow (17) NSWorkspace (19) Numbers (42) Pages (16) Safari (34) System Events (16) WKUserContentController (20) WKUserScript (19) WKUserScriptInjectionTimeAtDocumentEnd (17) WKWebView (21) WKWebViewConfiguration (21)

カテゴリー

  • AirDrop
  • AirPlay
  • Animation
  • AppleScript Application on Xcode
  • Bluetooth
  • boolean
  • Bug
  • Calendar
  • call by reference
  • Clipboard
  • Code Sign
  • Color
  • Custom Class
  • dialog
  • drive
  • exif
  • file
  • File path
  • filter
  • folder
  • Font
  • GAME
  • geolocation
  • GUI
  • GUI Scripting
  • History
  • How To
  • Icon
  • Image
  • Input Method
  • Internet
  • JavaScript
  • JSON
  • JXA
  • Keychain
  • Language
  • list
  • Locale
  • Machine Learning
  • Markdown
  • Menu
  • Metadata
  • MIDI
  • MIME
  • Natural Language Processing
  • Network
  • news
  • Noification
  • Notarization
  • Number
  • OCR
  • OSA
  • PDF
  • Peripheral
  • PRODUCTS
  • QR Code
  • Raw AppleEvent Code
  • Record
  • recursive call
  • regexp
  • Release
  • Remote Control
  • Require Control-Command-R to run
  • REST API
  • RTF
  • Sandbox
  • Screen Saver
  • Script Libraries
  • sdef
  • search
  • Security
  • shell script
  • Sort
  • Sound
  • Spellchecker
  • Spotlight
  • SVG
  • System
  • Tag
  • Telephony
  • Text
  • Text to Speech
  • timezone
  • Tools
  • Update
  • URL
  • UTI
  • Web Contents Control
  • WiFi
  • XML
  • XML-RPC
  • イベント(Event)
  • 未分類

アーカイブ

  • 2021年3月
  • 2021年2月
  • 2021年1月
  • 2020年12月
  • 2020年11月
  • 2020年10月
  • 2020年9月
  • 2020年8月
  • 2020年7月
  • 2020年6月
  • 2020年5月
  • 2020年4月
  • 2020年3月
  • 2020年2月
  • 2020年1月
  • 2019年12月
  • 2019年11月
  • 2019年10月
  • 2019年9月
  • 2019年8月
  • 2019年7月
  • 2019年6月
  • 2019年5月
  • 2019年4月
  • 2019年3月
  • 2019年2月
  • 2019年1月
  • 2018年12月
  • 2018年11月
  • 2018年10月
  • 2018年9月
  • 2018年8月
  • 2018年7月
  • 2018年6月
  • 2018年5月
  • 2018年4月
  • 2018年3月
  • 2018年2月

https://piyomarusoft.booth.pm/items/301502

メタ情報

  • 登録
  • ログイン
  • 投稿フィード
  • コメントフィード
  • WordPress.org
Proudly powered by WordPress
Theme: Flint by Star Verte LLC