Firefox

[firefox]WEBページのダウンロード保存(簡易版)


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004#
005#com.cocolog-nifty.quicktimer.icefloe
006----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
007use AppleScript version "2.8"
008use framework "Foundation"
009use framework "UniformTypeIdentifiers"
010use framework "AppKit"
011use scripting additions
012property refMe : a reference to current application
013
014set aliasSharedDirPath to (path to shared documents from user domain) as alias
015set strSharedDirPath to (POSIX path of aliasSharedDirPath) as text
016set ocidSharedDirPathStr to refMe's NSString's stringWithString:(strSharedDirPath)
017set ocidSharedDirPath to ocidSharedDirPathStr's stringByStandardizingPath()
018set ocidSharedDirPathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(ocidSharedDirPath) isDirectory:(false)
019set ocidSharedDownloadsDirPathURL to ocidSharedDirPathURL's URLByAppendingPathComponent:("Downloads") isDirectory:(true)
020#
021set appFileManager to refMe's NSFileManager's defaultManager()
022set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
023ocidAttrDict's setValue:(511) forKey:(refMe's NSFilePosixPermissions)
024set listDone to appFileManager's createDirectoryAtURL:(ocidSharedDownloadsDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error| :(reference)
025set aliasSharedDownloadsDirPath to (ocidSharedDownloadsDirPathURL's absoluteURL()) as alias
026
027set listURL to {"https://news.yahoo.co.jp/", "https://news.yahoo.co.jp/flash", "https://news.yahoo.co.jp/categories/world", "https://news.yahoo.co.jp/categories/domestic", "https://news.yahoo.co.jp/categories/business", "https://news.yahoo.co.jp/categories/entertainment", "https://news.yahoo.co.jp/categories/sports", "https://news.yahoo.co.jp/categories/it", "https://news.yahoo.co.jp/categories/life"}
028
029repeat with itemURL in listURL
030  
031  tell application id "org.mozilla.firefox"
032    close every window
033  end tell
034    delay 1
035  
036  tell application id "org.mozilla.firefox"
037    open location itemURL
038  end tell
039  delay 5
040  
041  
042  ###全面のタブのURLを取得して
043  ####ページ情報を開く
044  tell application "Firefox"
045    tell front window
046      activate
047      tell application "System Events"
048        tell process "Firefox"
049          keystroke "i" using {command down}
050        end tell
051      end tell
052    end tell
053  end tell
054  
055  delay 1
056  
057  #####ページ情報の名称を取得
058  tell application "Firefox"
059    tell window 1
060      set strPageName to name as text
061    end tell
062  end tell
063  
064  ####ページ情報を閉じる
065  tell application "Firefox"
066    tell window 1
067      close
068    end tell
069  end tell
070  
071  set strViewURL to doReplace(strPageName, "ページ情報 — ", "")
072  
073  
074  try
075    set strText to strViewURL as text
076    ####ペーストボード宣言
077    set appPasteboard to refMe's NSPasteboard's generalPasteboard()
078    set ocidText to (refMe's NSString's stringWithString:(strText))
079    appPasteboard's clearContents()
080    (appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString))
081  on error
082    tell application "Finder"
083      set the clipboard to strText as text
084    end tell
085  end try
086  
087  ###全面のタブのURLを取得して
088  ####ページ情報を開く
089  tell application "Firefox"
090    tell front window
091      activate
092      tell application "System Events"
093        tell process "Firefox"
094          keystroke "j" using {command down}
095        end tell
096      end tell
097    end tell
098  end tell
099  
100  delay 1
101  
102  ###全面のタブのURLを取得して
103  ####ページ情報を開く
104  tell application "Firefox"
105    tell front window
106      activate
107      tell application "System Events"
108        tell process "Firefox"
109          keystroke "v" using {command down}
110        end tell
111      end tell
112    end tell
113  end tell
114  
115  delay 1
116  
117  tell application id "org.mozilla.firefox"
118    close every window
119  end tell
120  
121end repeat
122
123
124####################################
125###### 文字の置換
126####################################
127to doReplace(theText, orgStr, newStr)
128  set oldDelim to AppleScript's text item delimiters
129  set AppleScript's text item delimiters to orgStr
130  set tmpList to every text item of theText
131  set AppleScript's text item delimiters to newStr
132  set tmpStr to tmpList as text
133  set AppleScript's text item delimiters to oldDelim
134  return tmpStr
135end doReplace
AppleScriptで生成しました

|

[workflow]Finderで選択中のファイルをFireFoxで開く(少し改良)

ダウンロード - openfirefox.workflow.zip


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

use AppleScript version "2.6"
use framework "Foundation"
use framework "AppKit"
use scripting additions


tell application id "org.mozilla.firefox" to launch
tell application "Finder" to activate



###対象は選択中のファイル
tell application "Finder"
  set listAliasPath to selection as list
end tell
###FireFoxの起動を待つ
tell application "Firefox" to launch
repeat 20 times
  tell application "Firefox"
    activate
    set boolFrontMost to frontmost as boolean
  end tell
  if boolFrontMost = true then
    exit repeat
  else
    delay 0.5
  end if
end repeat

repeat with itemAliasFilePath in listAliasPath
  set aliasAliasFilePath to itemAliasFilePath as alias
  tell application "Finder"
    set strUTI to (type identifier of (info for aliasAliasFilePath)) as text
  end tell
  set strFilePath to POSIX path of aliasAliasFilePath as text
  set ocidFilePath to (current application's NSString's stringWithString:strFilePath)
  set ocidFilePathURL to (current application's NSURL's fileURLWithPath:ocidFilePath)
  if strUTI is "com.apple.web-internet-location" then
    set ocidReadPlistData to (current application's NSMutableDictionary's dictionaryWithContentsOfURL:ocidFilePathURL |error|:(reference))
    set ocidPlistDict to item 1 of ocidReadPlistData
    try
      set strURL to (ocidPlistDict's valueForKey:"URL") as text
    on error
      set strUTI to "com.microsoft.internet-shortcut"
    end try
  else if strUTI is "com.microsoft.internet-shortcut" then
    set listReadString to (current application's NSString's stringWithContentsOfURL:ocidFilePathURL encoding:(current application's NSUTF8StringEncoding) |error|:(reference))
    set ocidReadString to item 1 of listReadString
    set ocidReadStringM to (current application's NSMutableString's alloc()'s initWithCapacity:0)
    ###行頭行末の改行を取ってから
    set ocidNSCharacterSet to current application's NSCharacterSet's whitespaceAndNewlineCharacterSet()
    set ocidReadString to (ocidReadString's stringByTrimmingCharactersInSet:ocidNSCharacterSet)
    ###可変テキストに格納して
(ocidReadStringM's setString:ocidReadString)
    ###改行取って
    set ocidStrRange to (ocidReadStringM's rangeOfString:ocidReadStringM)
(ocidReadStringM's replaceOccurrencesOfString:("\\s") withString:("") options:(current application's NSRegularExpressionSearch) range:ocidStrRange)
    ###不要な文字列を取って
    set ocidStrRange to (ocidReadStringM's rangeOfString:ocidReadStringM)
(ocidReadStringM's replaceOccurrencesOfString:"[InternetShortcut]URL=" withString:"" options:(current application's NSCaseInsensitiveSearch) range:ocidStrRange)
    set strURL to ocidReadStringM as text
  else
    set strURL to ocidFilePathURL's absoluteString() as text
  end if
  
  
  tell application "Firefox" to activate
  tell application "Firefox"
    open location strURL
  end tell
  
end repeat

|

[Firefox]連番URLを次々開く

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

#!/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 scripting additions

property refMe : a reference to current application

set appFileManager to refMe's NSFileManager's defaultManager()

###繰り返し回数
set numRepeatTimes to 50 as integer

###ウィンドウを閉じる待ち時間
set numWindowCloseDelay to 3 as integer


#####起動
tell application "Firefox"
  ###Firefoxを起動
  launch
  activate
end tell

#####起動チェック
repeat
  tell application "Firefox"
    ###起動確認
    activate
    set boolFrontMost to frontmost as boolean
  end tell
  if boolFrontMost is true then
    exit repeat
  else
    delay 1
  end if
end repeat

#####ウィンドがあるか?チェック
tell application "Firefox"
  tell window index 1
    activate
    set numWindowID to id as number
  end tell
end tell
if numWindowID = -1 then
  log "前面にウィンドウがありません"
  ###ウィンドウが無い場合は新規タブを開く
  set strURL to "about:newtab" as text
  tell application "Firefox"
    open location strURL
    tell window index 1
      set numWindowID to id as number
    end tell
  end tell
  ###最大10秒待つ処理
  repeat 10 times
    tell application "Firefox"
      try
        ###Window IDの取得を試みる
        tell window index 1
          set numWindowID to id as number
        end tell
        exit repeat
      on error
        ####Window IDが取れない場合は1秒待つ
        ####ウィンドID取れるまで繰り返す
        delay 1
      end try
    end tell
  end repeat
else
  log "前面にウィンドウ有り"
end if

######前面チェック
repeat 10 times
  tell application "Firefox"
    activate
    set boolFrontMost to frontmost as boolean
    if boolFrontMost is true then
      exit repeat
    else
      delay 1
    end if
  end tell
end repeat

tell application "Firefox"
  set frontmost to true
  tell window index 1
    activate
    set numWindowID to id as number
  end tell
  tell window id numWindowID
    activate
    repeat 10 times
      activate
      try
        set strWindowName to name as text
        exit repeat
      on error
        delay 1
      end try
    end repeat
  end tell
  if strWindowName is "Mozilla Firefox" then
    log "空のタブが前面"
  else
    log "URLが開かれている"
  end if
end tell


####ページ情報を開く
tell application "Firefox"
  tell window id numWindowID
    activate
    tell application "System Events"
      tell process "Firefox"
        keystroke "i" using {command down}
      end tell
    end tell
  end tell
end tell

delay 1

#####ページ情報の名称を取得
tell application "Firefox"
  tell window 1
    set strPageName to name as text
  end tell
end tell


####ページ情報を閉じる
tell application "Firefox"
  tell window 1
    close
  end tell
end tell


####URL取得
set strURL to doReplace(strPageName, "ページ情報 — ", "")
###URL処理
set ocidURLstr to (refMe's NSString's stringWithString:strURL)
set ocidURL to refMe's NSURL's URLWithString:ocidURLstr
set ocidBseURL to ocidURL's URLByDeletingLastPathComponent()

####カウントアップ
set numCntNo to 1 as integer
####繰り返し
repeat numRepeatTimes times
  ####URLに連番追加
  set ocidChkPage to ocidBseURL's URLByAppendingPathComponent:(numCntNo as text)
  ####テキストにして
  set strChkPage to ocidChkPage's absoluteString() as text
  try
    ####今開いているファイル
    tell application "Firefox"
      tell front window
        set numWindowID to index as number
      end tell
      ####新規でタブで開く
      open location strChkPage
      ####1秒まって
      delay 1
      ####新しいウィンドウ
      tell front window
        activate
        set numNewWindowID to index as number
      end tell
      delay numWindowCloseDelay
      ####前のページのウィンドウを閉じる
      tell window index numWindowID
        activate
        save
        close
      end tell
    end tell
    
  on error
    log "エラーしました"
    exit repeat
  end try
  
  set numCntNo to numCntNo + 1 as integer
end repeat


to doReplace(theText, orgStr, newStr)
  set oldDelim to AppleScript's text item delimiters
  set AppleScript's text item delimiters to orgStr
  set tmpList to every text item of theText
  set AppleScript's text item delimiters to newStr
  set tmpStr to tmpList as text
  set AppleScript's text item delimiters to oldDelim
  return tmpStr
end doReplace

|

[FireFox]ファイルをFirefoxで開く(考え中)

workflowでも使えるように考え中


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

#!/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.6"
use framework "Foundation"
use scripting additions


#####対象は選択中のファイル
tell application "Finder"
  set listAliasPath to selection as list
end tell


repeat with itemAliasFilePath in listAliasPath
  set strURL to "" as text
  set aliasAliasFilePath to itemAliasFilePath as alias
  tell application "Finder"
    set strUTI to (type identifier of (info for aliasAliasFilePath)) as text
  end tell
  set strFilePath to POSIX path of aliasAliasFilePath as text
  set ocidFilePath to (current application's NSString's stringWithString:strFilePath)
  set ocidFilePathURL to (current application's NSURL's fileURLWithPath:ocidFilePath)
  if strUTI is "com.apple.web-internet-location" then
    set ocidReadPlistData to (current application's NSMutableDictionary's dictionaryWithContentsOfURL:ocidFilePathURL |error|:(reference))
    set ocidPlistDict to item 1 of ocidReadPlistData
    try
      set strURL to (ocidPlistDict's valueForKey:"URL") as text
    on error
      set strUTI to "com.microsoft.internet-shortcut"
    end try
  end if
  if strUTI is "com.microsoft.internet-shortcut" then
    set listReadString to (current application's NSString's stringWithContentsOfURL:ocidFilePathURL encoding:(current application's NSUTF8StringEncoding) |error|:(reference))
    set ocidReadString to item 1 of listReadString
    set ocidReadStringM to (current application's NSMutableString's alloc()'s initWithCapacity:0)
    ###行頭行末の改行を取ってから
    set ocidNSCharacterSet to current application's NSCharacterSet's whitespaceAndNewlineCharacterSet()
    set ocidReadString to (ocidReadString's stringByTrimmingCharactersInSet:ocidNSCharacterSet)
    ###可変テキストに格納して
    (ocidReadStringM's setString:ocidReadString)
    ###改行取って
    set ocidStrRange to (ocidReadStringM's rangeOfString:ocidReadStringM)
    (ocidReadStringM's replaceOccurrencesOfString:("\\s") withString:("") options:(current application's NSRegularExpressionSearch) range:ocidStrRange)
    ###不要な文字列を取って
    set ocidStrRange to (ocidReadStringM's rangeOfString:ocidReadStringM)
    (ocidReadStringM's replaceOccurrencesOfString:"[InternetShortcut]URL=" withString:"" options:(current application's NSCaseInsensitiveSearch) range:ocidStrRange)
    set strURL to ocidReadStringM as text
  end if
  ####ロケーションファイル以外はfileで開く
  if strURL is "" then
    set strURL to ocidFilePathURL's absoluteString() as text
  end if
  
  
  
  tell application "Firefox" to activate
  tell application "Firefox"
    open location strURL
  end tell
  
end repeat

|

[FireFox]FireFoxでWEBサイトのURLを開く

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

#!/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 scripting additions

##URLNSURL
set strURL to "https://news.yahoo.co.jp/"
set ocidStrings to (current application's NSString's stringWithString:strURL)
set ocidStringsURL to (current application's NSURL's URLWithString:ocidStrings)

###アプリケーションのファイルURL
tell application id "org.mozilla.firefox"
  set strAppName to name as text
end tell
set aliasAppPath to path to application strAppName as alias
set strAppBundlePath to POSIX path of aliasAppPath as text
set ocidAppBundlePath to (current application's NSString's stringWithString:strAppBundlePath)
set ocidAppPathURL to (current application's NSURL's alloc()'s initFileURLWithPath:ocidAppBundlePath)


###開くURLを格納用のArrayを作成して
set ocidOpenURLArray to (current application's NSMutableArray's alloc()'s initWithCapacity:0)
###開くURLArrayに格納
(ocidOpenURLArray's addObject:ocidStringsURL)
####NSWorkspaceの初期化
set objNSWorkspace to current application's NSWorkspace's sharedWorkspace()
####コンフィグレーション
set ocidOpenConfiguration to current application's NSWorkspaceOpenConfiguration's configuration()
(ocidOpenConfiguration's setHides:(false as boolean))
(ocidOpenConfiguration's setRequiresUniversalLinks:(false as boolean))
####開く
set boolResponse to (objNSWorkspace's openURLs:ocidOpenURLArray withApplicationAtURL:ocidAppPathURL configuration:ocidOpenConfiguration completionHandler:(missing value))


|

[webloc] weblocファイルをFireFoxで開く(Automator対応)

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

#!/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 scripting additions


tell application "Finder"
  set listAliasFilePath to (get selection as alias list) as list
end tell

repeat with itemAliasFilePath in listAliasFilePath
  set strFilePath to POSIX path of itemAliasFilePath as text
  set ocidFilePath to (current application's NSString's stringWithString:strFilePath)
  set ocidFilePathURL to (current application's NSURL's fileURLWithPath:ocidFilePath)
  set ocidReadPlistData to (current application's NSMutableDictionary's dictionaryWithContentsOfURL:ocidFilePathURL |error|:(reference))
  set ocidPlistDict to item 1 of ocidReadPlistData
  set strURL to (ocidPlistDict's valueForKey:"URL") as text
  tell application "Firefox" to activate
  tell application "Firefox"
    open location strURL
  end tell
end repeat






NSWorkspace経由では普通には開くけど
Automator経由では開かなかった

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

#!/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 scripting additions

tell application "Finder"
  set listAliasFilePath to (get selection as alias list) as list
end tell

tell application id "org.mozilla.firefox"
  set strAppName to name as text
end tell

set aliasAppPath to path to application strAppName as alias
set strAppBundlePath to POSIX path of aliasAppPath as text
set ocidAppBundlePath to (current application's NSString's stringWithString:strAppBundlePath)
set ocidAppPathURL to (current application's NSURL's alloc()'s initFileURLWithPath:ocidAppBundlePath)
###開くURLを格納用のArrayを作成して
set ocidOpenURLArray to (current application's NSMutableArray's alloc()'s initWithCapacity:0)

repeat with itemAliasFilePath in listAliasFilePath
  set strFilePath to POSIX path of itemAliasFilePath as text
  set ocidFilePath to (current application's NSString's stringWithString:strFilePath)
  set ocidFilePathURL to (current application's NSURL's fileURLWithPath:ocidFilePath)
  
  ###開くURLArrayに格納
  (ocidOpenURLArray's addObject:ocidFilePathURL)
  ####NSWorkspaceの初期化
  set objNSWorkspace to current application's NSWorkspace's sharedWorkspace()
  ####コンフィグレーション
  set ocidOpenConfiguration to current application's NSWorkspaceOpenConfiguration's configuration()
  (ocidOpenConfiguration's setHides:(false as boolean))
  (ocidOpenConfiguration's setRequiresUniversalLinks:(false as boolean))
  ####開く
  set boolResponse to (objNSWorkspace's openURLs:ocidOpenURLArray withApplicationAtURL:ocidAppPathURL configuration:ocidOpenConfiguration completionHandler:(missing value))
  
  
end repeat

|

[Firefox]表示中のURLを取得する

System Events使いますトホホ




#####起動
tell application "Firefox"
###Firefoxを起動
launch
activate
end tell

#####起動チェック
repeat
tell application "Firefox"
###起動確認
activate
set boolFrontMost to frontmost as boolean
end tell
if boolFrontMost is true then
exit repeat
else
delay 1
end if
end repeat

#####ウィンドがあるか?チェック
tell application "Firefox"
tell window index 1
activate
set numWindowID to id as number
end tell
end tell
if numWindowID = -1 then
log "前面にウィンドウがありません"
###ウィンドウが無い場合は新規タブを開く
set strURL to "about:newtab" as text
tell application "Firefox"
open location strURL
tell window index 1
set numWindowID to id as number
end tell
end tell
###最大10秒待つ処理
repeat 10 times
tell application "Firefox"
try
###Window IDの取得を試みる
tell window index 1
set numWindowID to id as number
end tell
exit repeat
on error
####Window IDが取れない場合は1秒待つ
####ウィンドID取れるまで繰り返す
delay 1
end try
end tell
end repeat
else
log "前面にウィンドウ有り"
end if

######前面チェック
repeat 10 times
tell application "Firefox"
activate
set boolFrontMost to frontmost as boolean
if boolFrontMost is true then
exit repeat
else
delay 1
end if
end tell
end repeat

tell application "Firefox"
set frontmost to true
tell window index 1
activate
set numWindowID to id as number
end tell
tell window id numWindowID
activate
repeat 10 times
activate
try
set strWindowName to name as text
exit repeat
on error
delay 1
end try
end repeat
end tell
if strWindowName is "Mozilla Firefox" then
log "空のタブが前面"
else
log "URLが開かれている"
end if
end tell


####ページ情報を開く
tell application "Firefox"
tell window id numWindowID
activate
tell application "System Events"
tell process "Firefox"
keystroke "i" using {command down}
end tell
end tell
end tell
end tell

delay 1


#####ページ情報の名称を取得
tell application "Firefox"
tell window 1
set strPageName to name as text
end tell
end tell


####ページ情報を閉じる
tell application "Firefox"
tell window 1
close
end tell
end tell



set strURL to doReplace(strPageName, "ページ情報 — ", "")

log strURL


to doReplace(theText, orgStr, newStr)
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to orgStr
set tmpList to every text item of theText
set AppleScript's text item delimiters to newStr
set tmpStr to tmpList as text
set AppleScript's text item delimiters to oldDelim
return tmpStr
end doReplace

|

[Firefox] weblocファイルをFirefoxで開く

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application
property refNSString : a reference to refMe's NSString
property refNSURL : a reference to refMe's NSURL
property refNSMutableDictionary : a reference to refMe's NSMutableDictionary




on run
set strWithPrompt to "weblocファイルを選んでください"
set strRelativePath to ("~/Desktop/") as text
set strFilePath to (do shell script "echo " & strRelativePath & "") as text
set aliasDefLoc to POSIX file strFilePath as alias
set listFileType to {"com.apple.web-internet-location"} as list

set objDropFiles to (choose file default location aliasDefLoc ¬
with prompt strWithPrompt ¬
of type listFileType ¬
invisibles false ¬
with multiple selections allowed without showing package contents) as list
open objDropFiles
end run


on open objDropFiles

repeat with objFile in objDropFiles
###UNIXパスに
set strFilePath to POSIX path of objFile as text
####NSStringパスに
set ocidFilePath to (refNSString's stringWithString:strFilePath)
####NSURL
set ocidFileURL to (refNSURL's fileURLWithPath:ocidFilePath)
####weblocを読みこむ
set ocidReadPlistData to (refNSMutableDictionary's dictionaryWithContentsOfURL:ocidFileURL |error|:(reference))
set ocidPlistDict to item 1 of ocidReadPlistData
log item 2 of ocidReadPlistData
####URLを取り出し
set strURL to (ocidPlistDict's valueForKey:"URL") as text
log strURL
####Firefoxで開く
tell application "Firefox"
open location strURL
end tell

end repeat
end open




to doReplace(theText, orgStr, newStr)
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to orgStr
set tmpList to every text item of theText
set AppleScript's text item delimiters to newStr
set tmpStr to tmpList as text
set AppleScript's text item delimiters to oldDelim
return tmpStr
end doReplace

|

その他のカテゴリー

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