Changeset 153 for trunk/lingosource/castlib1/bbedit_Utilities.ls
- Timestamp:
- 02/21/08 07:51:08 (4 years ago)
- File:
-
- 1 edited
-
trunk/lingosource/castlib1/bbedit_Utilities.ls (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/bbedit_Utilities.ls
r151 r153 147 147 148 148 theResult = mSaveTextToTempFile(me, theText, tempSrcHFSPath) 149 --------------------- 150 151 mDoShellCmd(me, "bbedit " & tempSrcPath) 149 150 if theResult = 0 then 151 alert "Unable to save temp file:" && tempSrcHFSPath 152 else 153 mDoShellCmd(me, "bbedit " & tempSrcPath) 154 end if 155 152 156 153 157 end if … … 206 210 sel = the selection of castlib cl 207 211 208 if mCheckForXtra(me, "BudAPI") then 209 -- tempFolder = basysfolder("temp") 210 211 if the platform contains "mac" then 212 213 isMac = 1 214 resetUNames = 0 215 if baSysFolder("prefs") starts "/" then 216 baReturnUnixNames(0) 217 resetUNames = 1 218 end if 219 tempFolderHFS = basysfolder("temp") 220 baReturnUnixNames(1) 221 tempFolder = basysfolder("temp") 222 if resetUNames = 0 then 223 baReturnUnixNames(0) 224 end if 225 226 else 227 tempFolderHFS = basysfolder("temp") 228 tempFolder = tempFolderHFS 229 end if 230 231 232 else 233 alert "You need the buddyApi xtra for this operation" 234 exit 235 end if 212 isMac = (the platform contains "mac") 236 213 237 214 editor = mGetExternalScriptEditor(me) … … 258 235 if doLiveEdit then 259 236 --------------------- 260 tempSrc Path = tempFolder & "temp_LingoScript_file.ls"237 tempSrcHFSPath = mGetTempFilePath(me, "temp_LingoScript_file.ls") 261 238 262 239 if isMac then 263 240 waitparam = "" 264 241 editor = mGetMacBinary(me, editor) 265 tempSrc HFSPath = mConvertUnix2Hfs(me, tempSrcPath)242 tempSrcPath = mConvertHfs2Unix(me, tempSrcHFSPath) 266 243 else 267 waitparam = " \w"268 tempSrc HFSPath = tempSrcPath244 waitparam = " /wait" 245 tempSrcPath = tempSrcHFSPath 269 246 end if 270 247 --------------------- … … 272 249 theResult = mSaveTextToTempFile(me, theText, tempSrcHFSPath) 273 250 274 mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 275 276 theText = mGetTextFromFile(me, tempSrcHFSPath) 277 278 theText = mForceMacLineBreaks(me, theText) 279 280 if theType = #script then 281 memref.scripttext = theText 282 else if theType = #text then 283 memref.html = theText 284 else if theType = #field then 285 memref.text = theText 251 if theResult = 0 then 252 alert "Unable to save temp file:" && tempSrcHFSPath 253 else 254 255 mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 256 257 theText = mGetTextFromFile(me, tempSrcHFSPath) 258 259 if length(theText) < 1 then 260 alert "Temp file:" && tempSrcHFSPath && "contains no text. Changes will not be written to script." 261 262 else 263 264 theText = mForceMacLineBreaks(me, theText) 265 266 if theType = #script then 267 memref.scripttext = theText 268 else if theType = #text then 269 memref.html = theText 270 else if theType = #field then 271 memref.text = theText 272 end if 273 274 end if 275 286 276 end if 287 277 … … 295 285 --------------------- 296 286 -- create a temporary file from scripttext: 297 tempSrc Path = tempFolder & theName & ".ls"287 tempSrcHFSPath = mGetTempFilePath(me, theName & ".ls") 298 288 299 289 if isMac then 300 290 waitparam = " &" 301 editor = ""302 tempSrc HFSPath = tempSrcPath291 editor = mGetMacBinary(me, editor) 292 tempSrcPath = tempSrcHFSPath 303 293 else 304 294 waitparam = "" 305 tempSrc HFSPath = tempSrcPath295 tempSrcPath = tempSrcHFSPath 306 296 end if 307 297 … … 309 299 --------------------- 310 300 311 mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 301 if theResult = 0 then 302 alert "Unable to save temp file:" && tempSrcHFSPath 303 else 304 mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 305 end if 312 306 313 307 end if … … 355 349 #field: memref.text = theText 356 350 end case 351 352 else 353 alert "Temp file:" && tempSrcPath && "contains no text. Changes will not be written to script." 357 354 358 355 end if
Note: See TracChangeset
for help on using the changeset viewer.
